client

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(ctx context.Context, ccfg *ClientConfig) (*Client, error)

func (*Client) Clone

func (c *Client) Clone(ctx context.Context, name, clone string, opts ...grpc.CallOption) error

Clone a cache

func (*Client) Close

func (c *Client) Close() error

func (*Client) Commit

func (c *Client) Commit(ctx context.Context, name, candidate string, opts ...grpc.CallOption) error

func (*Client) Create

func (c *Client) Create(ctx context.Context, name string, opts ...grpc.CallOption) error

Create a new cache instance

func (*Client) CreateCandidate

func (c *Client) CreateCandidate(ctx context.Context, name, candidate, owner string, p int32, opts ...grpc.CallOption) error

Create a Candidate

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, name string, opts ...grpc.CallOption) error

Delete a cache instance

func (*Client) Discard

func (c *Client) Discard(ctx context.Context, name, candidate string, opts ...grpc.CallOption) error

Discard changes made to a candidate

func (*Client) Exists

func (c *Client) Exists(ctx context.Context, name string, opts ...grpc.CallOption) (bool, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, name string, opts ...grpc.CallOption) (*cachepb.GetResponse, error)

Get a single cache details

func (*Client) GetChanges

func (c *Client) GetChanges(ctx context.Context, name, candidate string, opts ...grpc.CallOption) ([]*cachepb.GetChangesResponse, error)

GetChanges made to a candidate

func (*Client) List

func (c *Client) List(ctx context.Context, opts ...grpc.CallOption) ([]string, error)

List cache instances

func (*Client) Modify

func (c *Client) Modify(ctx context.Context, name string, wo *ClientOpts, dels [][]string, upds []*cachepb.Update, opts ...grpc.CallOption) error

modify a cache instance

func (*Client) Prune

func (c *Client) Prune(ctx context.Context, name string, id string, force bool, opts ...grpc.CallOption) (*cachepb.PruneResponse, error)

func (*Client) Read

func (c *Client) Read(ctx context.Context, name string, ro *ClientOpts, paths [][]string, period time.Duration, opts ...grpc.CallOption) chan *cachepb.ReadResponse

Read value(s) from a cache instance

func (*Client) ReadKeys added in v0.0.34

func (c *Client) ReadKeys(ctx context.Context, name string, store cachepb.Store) (chan *cachepb.ReadResponse, error)

ReadKeys Read all the keys of the given store

func (*Client) Watch

func (c *Client) Watch(ctx context.Context, name string, store cache.Store, prefixes [][]string, opts ...grpc.CallOption) (chan *cachepb.WatchResponse, error)

type ClientConfig

type ClientConfig struct {
	// the cache server address
	Address string
	// number of read streams that can be opened concurrently
	// defaults to 1
	MaxReadStream int64
	// number of read streams that can be opened concurrently
	// defaults to 64
	MaxWatchStream int64
	// gRPC dial and unary RPCs timeout
	// defaults to 5s
	Timeout time.Duration
}

type ClientOpts

type ClientOpts struct {
	Store         cache.Store
	Owner         string
	Priority      int32
	PriorityCount uint64
	KeysOnly      bool
}

Jump to

Keyboard shortcuts

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