Documentation
¶
Index ¶
Constants ¶
View Source
const MaxBytesIDSize = 256
MaxBytesIDSize defines upper bound limit for number of bytes in a given semantic ID
Variables ¶
View Source
var ( // ErrIDTooBig happens when given ID is too big to be encoded as semantic ID // see also MaxBytesIDSize that defines this limit ErrIDTooBig = errors.New("value is too big to be encoded into semantic ID") // ErrIDEmpty happens when empty ID is asked to be decoded ErrIDEmpty = errors.New("can't encode empty value to semantic ID") // ErrInvalidChar happens when invalid character is found in a given semantic ID ErrInvalidChar = errors.New("given semantic ID contains invalid character") // ErrMalformedID happens when given semantic ID is malformed ErrMalformedID = errors.New("invalid semantic ID") )
Functions ¶
Types ¶
type IDCodec ¶
type IDCodec interface {
CanDecode(id string) bool
Encode(value []byte) (string, error)
Decode(id string) ([]byte, error)
GetPrefix() string
}
IDCodec defines an interface that abstracts out operations on the semantic IDs
func NewCodecForNames ¶
NewCodecForNames creates IDCodec for a given sequence of names
Click to show internal directories.
Click to hide internal directories.