Documentation ¶
Index ¶
Constants ¶
const StorageKIDPrefix = "k"
StorageKIDPrefix is the KID prefix for key IDs (used by localkms).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StorePrefixWrapper ¶
type StorePrefixWrapper struct {
// contains filtered or unexported fields
}
StorePrefixWrapper is a wrapper store that prepends IDPrefix to IDs. IDs will be stored in the embedded store with IDPrefix as prefix while the user of this wrapper store will interact the original unchanged ID.
func NewPrefixStoreWrapper ¶
func NewPrefixStoreWrapper(store storage.Store, prefix string) (*StorePrefixWrapper, error)
NewPrefixStoreWrapper creates a new StorePrefixWrapper of store.
func (*StorePrefixWrapper) Delete ¶
func (b *StorePrefixWrapper) Delete(k string) error
Delete will delete a record with k by prefixing it with IDPrefix first.
func (*StorePrefixWrapper) Get ¶
func (b *StorePrefixWrapper) Get(k string) ([]byte, error)
Get fetches the record based on k by first prefixing it with IDPrefix.
func (*StorePrefixWrapper) Iterator ¶
func (b *StorePrefixWrapper) Iterator(startKey, endKey string) storage.StoreIterator
Iterator returns an iterator for the latest snapshot of the underlying store.
Args:
startKey: Start of the key range, include in the range by converting it from base64 to IDPrefix encoded value first. endKey: End of the key range, not include in the range by converting it from base64 to IDPrefix encoded value first.
Returns:
StoreIterator: a wrapped iterator for result range.