Documentation
¶
Index ¶
- Variables
- func Decode(hashid string) ([]int, error)
- func DecodeKey(ctx context.Context, encoded string) (db.Key, error)
- func Encode(numbers ...int) string
- func EncodeKey(ctx context.Context, key interface{}) string
- func GetNamespace(ctx context.Context, hashid string) (string, error)
- func IgnoreFieldMismatch(err error) error
- func KeyExists(ctx context.Context, encoded string) (bool, error)
- func MustDecodeKey(ctx context.Context, encoded string) db.Key
- func RegisterNamespace(name string, id int64)
- type Key
- type KeyWithParent
- type Model
- type Namespace
Constants ¶
This section is empty.
Variables ¶
View Source
var MalformedHashId = errors.New("Hash id is malformed")
Functions ¶
func EncodeKey ¶
EncodeKey encodes a key to a string using hashid encoding The key parameter accepts any type that implements the Key interface
func IgnoreFieldMismatch ¶
IgnoreFieldMismatch is a helper for field mismatch errors
func RegisterNamespace ¶
RegisterNamespace caches a namespace mapping
Types ¶
type Key ¶
Key interface for encoding/decoding Note: Due to Go's strict interface matching, this interface defines Parent() as returning interface{} to allow any key type to be passed
type KeyWithParent ¶
type KeyWithParent interface {
Key
Parent() interface{}
}
KeyWithParent is for keys that have a parent
Click to show internal directories.
Click to hide internal directories.