filekv

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package template contains the Example store implementation. This package is a template only.

Index

Constants

View Source
const StoreName = "filekv"

StoreName the name of the store. TODO implement me.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ProtoconfRoot string
}

Config the Example configuration. TODO implement me.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store implements the store.Store interface. TODO implement me.

func New

func New(ctx context.Context, endpoints []string, options *Config) (*Store, error)

New creates a new Example client. TODO implement me.

func (Store) AtomicDelete

func (s Store) AtomicDelete(ctx context.Context, key string, previous *store.KVPair) (bool, error)

AtomicDelete Atomic delete of a single value.

func (Store) AtomicPut

func (s Store) AtomicPut(ctx context.Context, key string, value []byte, previous *store.KVPair, opts *store.WriteOptions) (bool, *store.KVPair, error)

AtomicPut Atomic CAS operation on a single value. Pass previous = nil to create a new key.

func (*Store) Close

func (w *Store) Close() error

func (Store) Delete

func (s Store) Delete(ctx context.Context, key string) error

Delete the value at the specified key.

func (Store) DeleteTree

func (s Store) DeleteTree(ctx context.Context, directory string) error

DeleteTree deletes a range of keys under a given directory.

func (Store) Exists

func (s Store) Exists(ctx context.Context, key string, opts *store.ReadOptions) (bool, error)

Exists Verify if a Key exists in the store.

func (Store) Get

func (s Store) Get(ctx context.Context, key string, opts *store.ReadOptions) (*store.KVPair, error)

Get a value given its key.

func (Store) List

func (s Store) List(ctx context.Context, directory string, opts *store.ReadOptions) ([]*store.KVPair, error)

List the content of a given prefix.

func (Store) NewLock

func (s Store) NewLock(ctx context.Context, key string, opts *store.LockOptions) (store.Locker, error)

NewLock creates a lock for a given key. The returned Locker is not held and must be acquired with `.Lock`. The Value is optional.

func (Store) Put

func (s Store) Put(ctx context.Context, key string, value []byte, opts *store.WriteOptions) error

Put a value at the specified key.

func (*Store) Watch

func (s *Store) Watch(ctx context.Context, key string, opts *store.ReadOptions) (<-chan *store.KVPair, error)

Watch for changes on a key.

func (Store) WatchTree

func (s Store) WatchTree(ctx context.Context, directory string, opts *store.ReadOptions) (<-chan []*store.KVPair, error)

WatchTree watches for changes on child nodes under a given directory.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL