kv

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKVKeyExsist            = errors.New("error Key existed")
	ErrKVKeyNotExsist         = errors.New("error Key not existed")
	ErrKVStateVersionMismatch = errors.New("error KV state version mismatch")
)

Functions

This section is empty.

Types

type DaprStateCache added in v0.4.0

type DaprStateCache struct {
	Value   []byte
	Version string
	// contains filtered or unexported fields
}

type DaprStateOprator

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

func NewDaprStateOperator

func NewDaprStateOperator(interval, storeName string, c dapr.Client) *DaprStateOprator

dapr state.

func (*DaprStateOprator) Create

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

func (*DaprStateOprator) Delete

func (o *DaprStateOprator) Delete(ctx context.Context, key string) error

func (*DaprStateOprator) Get

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

func (*DaprStateOprator) Update

func (o *DaprStateOprator) Update(ctx context.Context, key string, value []byte, version string) error

func (*DaprStateOprator) Watch added in v0.4.0

func (o *DaprStateOprator) Watch(ctx context.Context, key string, cb func(value []byte, version string) error) error

type Operator

type Operator interface {
	// Create KV.
	Create(ctx context.Context, key string, value []byte) error
	// Update KV.
	Update(ctx context.Context, key string, value []byte, version string) error
	// Get KV.
	Get(ctx context.Context, key string) (value []byte, version string, err error)
	// Delete KV.
	Delete(ctx context.Context, key string) error
	// Watch KV.
	Watch(ctx context.Context, key string, cb func(value []byte, version string) error) error
}

Operator contains all operations to KV.

Jump to

Keyboard shortcuts

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