Documentation ¶
Index ¶
- Constants
- Variables
- func BString(b []byte) string
- func LockID() string
- func MaxOpenConn() int64
- func Namespace(s string) *string
- func NewLeaderMonitorReceiver() *chan bool
- func SetBalancer(balancer Balancer)
- func SetMaxOpenConn(size int64)
- type Balancer
- type BalancerConn
- type Client
- type Conn
- type ConnectionManager
- type InternalClient
- type KvClient
- type LockerClient
- type MutexLock
- type Value
- type WatchValue
- type Watcher
- type WatcherOption
Constants ¶
View Source
const DefaultWatchBufSize uint32 = 8
Variables ¶
View Source
var (
ErrWatcherClosed = errors.New("watcher has closed")
)
Functions ¶
func MaxOpenConn ¶
func MaxOpenConn() int64
func NewLeaderMonitorReceiver ¶
func NewLeaderMonitorReceiver() *chan bool
func SetBalancer ¶
func SetBalancer(balancer Balancer)
func SetMaxOpenConn ¶
func SetMaxOpenConn(size int64)
Types ¶
type BalancerConn ¶
type BalancerConn struct { ID string *grpc.ClientConn }
func (*BalancerConn) Key ¶
func (c *BalancerConn) Key() string
func (*BalancerConn) Value ¶
func (c *BalancerConn) Value() *grpc.ClientConn
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 }
func NewClientConn ¶
type ConnectionManager ¶
type ConnectionManager struct {
// contains filtered or unexported fields
}
func NewConnectionManager ¶
func NewConnectionManager(ctx context.Context, endpoint string, maxConn int, opts ...grpc.DialOption) (*ConnectionManager, error)
func (*ConnectionManager) Alloc ¶
func (m *ConnectionManager) Alloc() (*grpc.ClientConn, error)
func (*ConnectionManager) Close ¶
func (m *ConnectionManager) Close() error
func (*ConnectionManager) Target ¶
func (m *ConnectionManager) Target() string
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 WatchPrefix(ctx context.Context, watcher *Watcher) error }
type LockerClient ¶
type MutexLock ¶
type MutexLock struct {
// contains filtered or unexported fields
}
func NewMutexLock ¶
type WatchValue ¶
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
func NewWatcher ¶
func NewWatcher(key []byte, 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 WatchWithIgnoreErrors ¶
func WatchWithIgnoreErrors() WatcherOption
func WatchWithNamespace ¶
func WatchWithNamespace(namespace *string) WatcherOption
func WatchWithPrefix ¶
func WatchWithPrefix() WatcherOption
Source Files ¶
Click to show internal directories.
Click to hide internal directories.