Documentation ¶
Index ¶
- Constants
- func MakePartnerPrefix(id *id.ID) string
- type KV
- func (v *KV) Delete(key string, version uint64) error
- func (v *KV) Exists(err error) bool
- func (v *KV) Get(key string, version uint64) (*Object, error)
- func (v *KV) GetAndUpgrade(key string, ut UpgradeTable) (*Object, error)
- func (v *KV) GetFullKey(key string, version uint64) string
- func (v *KV) GetPrefix() string
- func (v *KV) IsMemStore() bool
- func (v *KV) Prefix(prefix string) *KV
- func (v *KV) Set(key string, object *Object) error
- type Object
- type Upgrade
- type UpgradeTable
Constants ¶
View Source
const PrefixSeparator = "/"
Variables ¶
This section is empty.
Functions ¶
func MakePartnerPrefix ¶
MakePartnerPrefix creates a string prefix to denote who a conversation or relationship is with
Types ¶
type KV ¶
type KV struct {
// contains filtered or unexported fields
}
KV stores versioned data and Upgrade functions
func (*KV) Get ¶
Get gets and upgrades data stored in the key/value store Make sure to inspect the version returned in the versioned object
func (*KV) GetAndUpgrade ¶
func (v *KV) GetAndUpgrade(key string, ut UpgradeTable) (*Object, error)
Get gets and upgrades data stored in the key/value store Make sure to inspect the version returned in the versioned object
func (*KV) GetFullKey ¶
Returns the key with all prefixes appended
func (*KV) IsMemStore ¶
type Object ¶
type Object struct { // Used to determine version Upgrade, if any Version uint64 // Set when this object is written Timestamp time.Time // Serialized version of original object Data []byte }
Object is used by VersionedKeyValue to keep track of versioning and time of storage
type UpgradeTable ¶
Click to show internal directories.
Click to hide internal directories.