Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultWatchBufSize uint32 = 4
Variables ¶
View Source
var (
ErrWatcherClosed = errors.New("watcher has closed")
)
Functions ¶
Types ¶
type Client ¶
type Client struct {
InternalClient
KvClient
LockerClient
// contains filtered or unexported fields
}
type Conn ¶
type Conn interface {
ReadOnly() (*grpc.ClientConn, error)
WriteOnly() (*grpc.ClientConn, error)
Close() error
}
type InternalClient ¶
type KvClient ¶
type KvClient interface {
Set(ctx context.Context, key, value []byte, ttl uint32, namespace *string) error
Get(ctx context.Context, key []byte, namespace *string) (*Value, error)
PrefixScan(ctx context.Context, prefix []byte, offset, limit uint64, reg, namespace *string) ([]*Value, error)
TrySet(ctx context.Context, key, value []byte, ttl uint32, namespace *string) error
Delete(ctx context.Context, key []byte, namespace *string) error
Watch(ctx context.Context, watcher *Watcher) error
}
type LockerClient ¶
type WatchValue ¶
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
func NewWatcher ¶
func NewWatcher(key []byte, ignoreErrors bool, opts ...WatcherOption) *Watcher
func (*Watcher) Notify ¶
func (w *Watcher) Notify() (chan *WatchValue, error)
type WatcherOption ¶
type WatcherOption func(*Watcher)
func WatchWithBufSize ¶
func WatchWithBufSize(bufSize uint32) WatcherOption
func WatchWithNamespace ¶
func WatchWithNamespace(namespace *string) WatcherOption
Source Files
¶
Click to show internal directories.
Click to hide internal directories.