coder

package
v0.0.0-...-f584327 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RevisionValueLength                 = 8
	RevisionValueLengthWithDeletionFlag = 9
)

Variables

View Source
var (
	ErrInvalidRevFormat = errors.New("invalid format of revision bytes")
)

Functions

func ParseRevision

func ParseRevision(revisionBytes []byte) (rev uint64, isTombStone bool, err error)

ParseRevision parses revision bytes

Types

type Coder

type Coder interface {
	// EncodeObjectKey encodes user key to internal object key
	EncodeObjectKey(key []byte, revision uint64) []byte

	// EncodeRevisionKey encodes user key to internal revision key
	// todo: deprecated
	EncodeRevisionKey(key []byte) []byte

	// Decode decodes internal key to user key and revision
	Decode(internalKey []byte) (userKey []byte, revision uint64, err error)
}

Coder defines the interface that transforms user key to and from internal key

func NewNormalCoder

func NewNormalCoder() Coder

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL