Documentation ¶
Index ¶
- Constants
- Variables
- func Namespace() string
- func NamespaceKeyPrefix() string
- func SetNamespace(ns string)
- type Key
- func MustSucceed(key Key, err error) Key
- func NewKey(value string) Key
- func NewKeyFromBytesUnchecked(value []byte) Key
- func NewKeyFromParts(parts ...string) (key Key, err error)
- func NewKeyFromString(value string) (key Key, err error)
- func NewKeyFromStringUnchecked(value string) Key
- func NewKeys(values ...string) []Key
Constants ¶
const ( KeySeparator = "/" PrefixSeparator = "$" )
Variables ¶
var ( ErrNotEnoughParts = errors.New("ErrNotEnoughParts") ErrInvalidKeyFormat = errors.New("ErrInvalidKeyFormat") )
Functions ¶
func NamespaceKeyPrefix ¶
func NamespaceKeyPrefix() string
Types ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
A Key is a structured abstraction of a Couchbase nosql identifier.
func MustSucceed ¶
MustSucceed is a handy wrapper for panicking when creating a new Key. Example: MustSucceed(NewKeyFromString("xyz")).
func NewKey ¶
NewKey constructs a new keys from the given fully qualified string. It will panic if the string isn't valid. Use NewKeyFromString if you don't want to panic.
func NewKeyFromBytesUnchecked ¶
NewKeyFromBytesUnchecked creates a new keys from the given byte array without validation of any kind.
func NewKeyFromParts ¶
NewKeyFromParts creates a new keys within the current core.Namespace.
func NewKeyFromString ¶
NewKeyFromString creates a new keys within the current core.Namespace from a string representation, validating each part.
func NewKeyFromStringUnchecked ¶
NewKeyFromStringUnchecked creates a new keys from the given byte array without validation of any kind.