kv

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package kv is a generated GoMock package.

Index

Constants

View Source
const (
	ResourceEventbus          = "/vanus/core/eventbus_controller/eventbus"
	ResourceEventlog          = "/vanus/core/eventbus_controller/eventlog"
	ResourceSegment           = "/vanus/core/eventbus_controller/segment"
	ResourceSegmentOfEventlog = "/vanus/core/eventbus_controller/segs_of_eventlog"
	ResourceVolumeMetadata    = "/vanus/core/eventbus_controller/volume/metadata"
	ResourceVolumeBlock       = "/vanus/core/eventbus_controller/volume/block"
	ResourceVolumeInstance    = "/vanus/core/eventbus_controller/volume/instance"
	ResourceSubscription      = "/vanus/core/trigger_controller/subscriptions"
	MetadataSecret            = "/vanus/core/trigger_controller/secrets" //nolint:gosec // ok
	MetadataOffset            = "/vanus/core/trigger_controller/offsets"
	TriggerWorker             = "/vanus/core/trigger_controller/trigger_workers"
	ClusterNode               = "/vanus/core/cluster/nodes"
	ClusterStart              = "/vanus/core/cluster/start_at"
)

Variables

View Source
var (
	ErrKeyNotFound = errors.New("key not found")
	ErrNodeExist   = errors.New("node exist")
	ErrSetFailed   = errors.New("set failed")
	ErrUnknown     = errors.New("unknown")
)

Functions

func ComponentLeaderKey

func ComponentLeaderKey(component string) string

func DistributedLockKey

func DistributedLockKey(component string) string

func NamespaceAllKey

func NamespaceAllKey() string

func NamespaceKey

func NamespaceKey(id vanus.ID) string

func UserAllKey

func UserAllKey() string

func UserKey

func UserKey(identifier string) string

func UserRoleAllKey

func UserRoleAllKey() string

func UserRoleKey

func UserRoleKey(identifier, role string) string

func UserTokenAllKey

func UserTokenAllKey() string

func UserTokenKey

func UserTokenKey(id vanus.ID) string

Types

type Action

type Action string
const (
	Create Action = "create"
	Delete Action = "delete"
	Update Action = "update"
)

type Client

type Client interface {
	Get(ctx context.Context, key string) ([]byte, error)
	Create(ctx context.Context, key string, value []byte) error
	Set(ctx context.Context, key string, value []byte) error
	Update(ctx context.Context, key string, value []byte) error
	Exists(ctx context.Context, key string) (bool, error)
	SetWithTTL(ctx context.Context, key string, value []byte, ttl time.Duration) error
	Delete(ctx context.Context, key string) error
	DeleteDir(ctx context.Context, path string) error
	List(ctx context.Context, path string) ([]Pair, error)
	Watch(ctx context.Context, key string, stopCh <-chan struct{}) (chan Pair, chan error)
	WatchTree(ctx context.Context, path string, stopCh <-chan struct{}) (chan Pair, chan error)
	CompareAndSwap(ctx context.Context, key string, preValue, value []byte) error
	CompareAndDelete(ctx context.Context, key string, preValue []byte) error
	Close() error
}

type MockClient

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

MockClient is a mock of Client interface.

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) Close

func (m *MockClient) Close() error

Close mocks base method.

func (*MockClient) CompareAndDelete

func (m *MockClient) CompareAndDelete(ctx context.Context, key string, preValue []byte) error

CompareAndDelete mocks base method.

func (*MockClient) CompareAndSwap

func (m *MockClient) CompareAndSwap(ctx context.Context, key string, preValue, value []byte) error

CompareAndSwap mocks base method.

func (*MockClient) Create

func (m *MockClient) Create(ctx context.Context, key string, value []byte) error

Create mocks base method.

func (*MockClient) Delete

func (m *MockClient) Delete(ctx context.Context, key string) error

Delete mocks base method.

func (*MockClient) DeleteDir

func (m *MockClient) DeleteDir(ctx context.Context, path string) error

DeleteDir mocks base method.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClient) Exists

func (m *MockClient) Exists(ctx context.Context, key string) (bool, error)

Exists mocks base method.

func (*MockClient) Get

func (m *MockClient) Get(ctx context.Context, key string) ([]byte, error)

Get mocks base method.

func (*MockClient) List

func (m *MockClient) List(ctx context.Context, path string) ([]Pair, error)

List mocks base method.

func (*MockClient) Set

func (m *MockClient) Set(ctx context.Context, key string, value []byte) error

Set mocks base method.

func (*MockClient) SetWithTTL

func (m *MockClient) SetWithTTL(ctx context.Context, key string, value []byte, ttl time.Duration) error

SetWithTTL mocks base method.

func (*MockClient) Update

func (m *MockClient) Update(ctx context.Context, key string, value []byte) error

Update mocks base method.

func (*MockClient) Watch

func (m *MockClient) Watch(ctx context.Context, key string, stopCh <-chan struct{}) (chan Pair, chan error)

Watch mocks base method.

func (*MockClient) WatchTree

func (m *MockClient) WatchTree(ctx context.Context, path string, stopCh <-chan struct{}) (chan Pair, chan error)

WatchTree mocks base method.

type MockClientMockRecorder

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) Close

func (mr *MockClientMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockClientMockRecorder) CompareAndDelete

func (mr *MockClientMockRecorder) CompareAndDelete(ctx, key, preValue interface{}) *gomock.Call

CompareAndDelete indicates an expected call of CompareAndDelete.

func (*MockClientMockRecorder) CompareAndSwap

func (mr *MockClientMockRecorder) CompareAndSwap(ctx, key, preValue, value interface{}) *gomock.Call

CompareAndSwap indicates an expected call of CompareAndSwap.

func (*MockClientMockRecorder) Create

func (mr *MockClientMockRecorder) Create(ctx, key, value interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockClientMockRecorder) Delete

func (mr *MockClientMockRecorder) Delete(ctx, key interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockClientMockRecorder) DeleteDir

func (mr *MockClientMockRecorder) DeleteDir(ctx, path interface{}) *gomock.Call

DeleteDir indicates an expected call of DeleteDir.

func (*MockClientMockRecorder) Exists

func (mr *MockClientMockRecorder) Exists(ctx, key interface{}) *gomock.Call

Exists indicates an expected call of Exists.

func (*MockClientMockRecorder) Get

func (mr *MockClientMockRecorder) Get(ctx, key interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockClientMockRecorder) List

func (mr *MockClientMockRecorder) List(ctx, path interface{}) *gomock.Call

List indicates an expected call of List.

func (*MockClientMockRecorder) Set

func (mr *MockClientMockRecorder) Set(ctx, key, value interface{}) *gomock.Call

Set indicates an expected call of Set.

func (*MockClientMockRecorder) SetWithTTL

func (mr *MockClientMockRecorder) SetWithTTL(ctx, key, value, ttl interface{}) *gomock.Call

SetWithTTL indicates an expected call of SetWithTTL.

func (*MockClientMockRecorder) Update

func (mr *MockClientMockRecorder) Update(ctx, key, value interface{}) *gomock.Call

Update indicates an expected call of Update.

func (*MockClientMockRecorder) Watch

func (mr *MockClientMockRecorder) Watch(ctx, key, stopCh interface{}) *gomock.Call

Watch indicates an expected call of Watch.

func (*MockClientMockRecorder) WatchTree

func (mr *MockClientMockRecorder) WatchTree(ctx, path, stopCh interface{}) *gomock.Call

WatchTree indicates an expected call of WatchTree.

type Pair

type Pair struct {
	Key    string
	Value  []byte
	Action Action
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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