Documentation ¶
Index ¶
- func New(ctx context.Context, connection string, tlsInfo tls.Config) (server.Backend, error)
- func NewLegacy(ctx context.Context, connection string, tlsInfo tls.Config) (server.Backend, error)
- type Backend
- func (b *Backend) Close() error
- func (b *Backend) Count(ctx context.Context, prefix string) (int64, int64, error)
- func (b *Backend) Create(ctx context.Context, key string, value []byte, lease int64) (int64, error)
- func (b *Backend) DbSize(ctx context.Context) (int64, error)
- func (b *Backend) Delete(ctx context.Context, key string, revision int64) (int64, *server.KeyValue, bool, error)
- func (b *Backend) Get(ctx context.Context, key, rangeEnd string, limit, revision int64) (int64, *server.KeyValue, error)
- func (b *Backend) List(ctx context.Context, prefix, startKey string, limit, maxRevision int64) (int64, []*server.KeyValue, error)
- func (b *Backend) Start(ctx context.Context) error
- func (b *Backend) Update(ctx context.Context, key string, value []byte, revision, lease int64) (int64, *server.KeyValue, bool, error)
- func (b *Backend) Watch(ctx context.Context, prefix string, startRevision int64) server.WatchResult
- type BackendLogger
- func (b *BackendLogger) Count(ctx context.Context, prefix string) (revRet int64, count int64, err error)
- func (b *BackendLogger) Create(ctx context.Context, key string, value []byte, lease int64) (revRet int64, errRet error)
- func (b *BackendLogger) DbSize(ctx context.Context) (int64, error)
- func (b *BackendLogger) Delete(ctx context.Context, key string, revision int64) (revRet int64, kvRet *server.KeyValue, deletedRet bool, errRet error)
- func (b *BackendLogger) Get(ctx context.Context, key, rangeEnd string, limit, revision int64) (revRet int64, kvRet *server.KeyValue, errRet error)
- func (b *BackendLogger) List(ctx context.Context, prefix, startKey string, limit, revision int64) (revRet int64, kvRet []*server.KeyValue, errRet error)
- func (b *BackendLogger) Start(ctx context.Context) error
- func (b *BackendLogger) Update(ctx context.Context, key string, value []byte, revision, lease int64) (revRet int64, kvRet *server.KeyValue, updateRet bool, errRet error)
- func (b *BackendLogger) Watch(ctx context.Context, prefix string, revision int64) server.WatchResult
- type Config
- type KeyValue
- func (e *KeyValue) BucketRevision() int64
- func (e *KeyValue) BucketSize(ctx context.Context) (int64, error)
- func (e *KeyValue) Count(ctx context.Context, prefix string) (int64, error)
- func (e *KeyValue) Create(ctx context.Context, key string, value []byte) (uint64, error)
- func (e *KeyValue) Delete(ctx context.Context, key string, opts ...jetstream.KVDeleteOpt) error
- func (e *KeyValue) Get(ctx context.Context, key string) (jetstream.KeyValueEntry, error)
- func (e *KeyValue) GetRevision(ctx context.Context, key string, revision uint64) (jetstream.KeyValueEntry, error)
- func (e *KeyValue) List(ctx context.Context, prefix, startKey string, limit, revision int64) ([]jetstream.KeyValueEntry, error)
- func (e *KeyValue) Update(ctx context.Context, key string, value []byte, last uint64) (uint64, error)
- func (e *KeyValue) Watch(ctx context.Context, keys string, startRev int64) (jetstream.KeyWatcher, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
func (*Backend) Count ¶
Count returns an exact count of the number of matching keys and the current revision of the database.
func (*Backend) Create ¶
Create attempts to create the key-value entry and returns the revision number.
func (*Backend) Get ¶
func (b *Backend) Get(ctx context.Context, key, rangeEnd string, limit, revision int64) (int64, *server.KeyValue, error)
Get returns the store's current revision, the associated server.KeyValue or an error.
func (*Backend) List ¶
func (b *Backend) List(ctx context.Context, prefix, startKey string, limit, maxRevision int64) (int64, []*server.KeyValue, error)
List returns a range of keys starting with the prefix. This would translated to one or more tokens, e.g. `a.b.c`. The startKey would be the next set of tokens that follow the prefix that are alphanumerically equal to or greater than the startKey. If limit is provided, the maximum set of matches is limited. If revision is provided, this indicates the maximum revision to return.
func (*Backend) Start ¶
Start starts the backend. See https://github.com/kubernetes/kubernetes/blob/442a69c3bdf6fe8e525b05887e57d89db1e2f3a5/staging/src/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go#L97
type BackendLogger ¶
type BackendLogger struct {
// contains filtered or unexported fields
}
func (*BackendLogger) Count ¶
func (b *BackendLogger) Count(ctx context.Context, prefix string) (revRet int64, count int64, err error)
Count returns an exact count of the number of matching keys and the current revision of the database
func (*BackendLogger) Create ¶
func (b *BackendLogger) Create(ctx context.Context, key string, value []byte, lease int64) (revRet int64, errRet error)
Create attempts to create the key-value entry and returns the revision number.
func (*BackendLogger) DbSize ¶
func (b *BackendLogger) DbSize(ctx context.Context) (int64, error)
DbSize get the kineBucket size from JetStream.
func (*BackendLogger) Get ¶
func (b *BackendLogger) Get(ctx context.Context, key, rangeEnd string, limit, revision int64) (revRet int64, kvRet *server.KeyValue, errRet error)
Get returns the store's current revision, the associated server.KeyValue or an error.
func (*BackendLogger) Watch ¶
func (b *BackendLogger) Watch(ctx context.Context, prefix string, revision int64) server.WatchResult
type KeyValue ¶
type KeyValue struct {
// contains filtered or unexported fields
}
func NewKeyValue ¶
func (*KeyValue) BucketRevision ¶
BucketRevision returns the latest revision of the bucket.
func (*KeyValue) BucketSize ¶
BucketSize returns the size of the bucket in bytes.