Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEntryNotFound should be returned when a registry key does not exist // in the registry. ErrEntryNotFound = errors.New("entry not found") // ErrNotEnoughSpace should be returned when the registry is full and // there is no more space to store a new entry. ErrNotEnoughSpace = errors.New("not enough space") )
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
A Manager manages registry entries stored in a RegistryStore.
func NewManager ¶
NewManager returns a new registry manager.
func (*Manager) Entries ¶
Entries returns the current and maximum number of entries the registry can hold.
func (*Manager) Get ¶
func (r *Manager) Get(key rhp3.RegistryKey) (value rhp3.RegistryValue, err error)
Get returns the registry value for the provided key.
func (*Manager) Put ¶
func (r *Manager) Put(entry rhp3.RegistryEntry, expirationHeight uint64) (rhp3.RegistryValue, error)
Put creates or updates the registry value for the provided key. If err is nil the new value is returned, otherwise the previous value is returned.
type Store ¶
type Store interface { // GetRegistryValue returns the registry value for the given key. If the key is not // found should return ErrEntryNotFound. GetRegistryValue(key rhp3.RegistryKey) (entry rhp3.RegistryValue, _ error) // SetRegistryValue sets the registry value for the given key. If the // value would exceed the maximum number of entries, should return // ErrNotEnoughSpace. SetRegistryValue(entry rhp3.RegistryEntry, expiration uint64) error // RegistryEntries returns the current number of entries as well as the // maximum number of entries the registry can hold. RegistryEntries() (count uint64, total uint64, err error) IncrementRegistryAccess(read, write uint64) error }
A Store stores host registry entries. The registry is a key/value store for small data.
Click to show internal directories.
Click to hide internal directories.