Documentation
¶
Overview ¶
Package namer represent interface to templates creation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultKey ¶
type DefaultKey struct {
// contains filtered or unexported fields
}
DefaultKey implements default realization.
func NewDefaultKey ¶
func NewDefaultKey(name string, keytype KeyType, property string, raw string) DefaultKey
NewDefaultKey returns new Key object.
func (DefaultKey) Property ¶
func (k DefaultKey) Property() string
Property returns property of the key.
type DefaultNamer ¶
type DefaultNamer struct {
// contains filtered or unexported fields
}
DefaultNamer represents default namer.
func (*DefaultNamer) GenerateNames ¶
func (n *DefaultNamer) GenerateNames(name string) ([]Key, error)
GenerateNames all keys for an object name.
func (*DefaultNamer) ParseKey ¶
func (n *DefaultNamer) ParseKey(name string) (DefaultKey, error)
ParseKey parses a raw key name into a structured DefaultKey.
type InvalidKeyError ¶
InvalidKeyError represents an error for invalid key format.
func (InvalidKeyError) Error ¶
func (e InvalidKeyError) Error() string
type InvalidNameError ¶
InvalidNameError represents an error for invalid name format.
func (InvalidNameError) Error ¶
func (e InvalidNameError) Error() string
type Key ¶
type Key interface {
Name() string // Get object name.
Type() KeyType // Get key type.
Property() string // Get metadata (e.g., algorithm version).
Build() string // Reconstruct raw key string.
}
Key defines the minimal interface required by keys.
type Namer ¶
type Namer interface {
GenerateNames(name string) ([]Key, error)
ParseKey(name string) (DefaultKey, error)
ParseKeys(names []string, ignoreError bool) (Results, error)
Prefix(val string, isPrefix bool) string
}
Namer defines the interface for generating and parsing storage key names.
type Results ¶
type Results struct {
// contains filtered or unexported fields
}
Results represents Namer working result.
func NewResults ¶
NewResults creates a new Results instance from the provided initial data.
func (*Results) SelectSingle ¶
SelectSingle gets keys for single-name case (if applicable).