Documentation ¶
Index ¶
- Constants
- func PrefixEnd(prefix string) string
- func WithLimit(limit int64) *withLimit
- func WithMaxConcurrent(n uint) *withMaxConcurrent
- func WithPrefix() *withPrefix
- func WithRevision(rev uint64) *withRevision
- func WithTTL(ttl int64) *withTTL
- type Client
- type CompactOption
- type CompactRequest
- type CompactResponse
- type Config
- type CountOption
- type CountRequest
- type CountResponse
- type CreateOption
- type CreateRequest
- type CreateResponse
- type DeleteOption
- type DeleteRequest
- type DeleteResponse
- type Event
- type GetOption
- type GetRequest
- type GetResponse
- type Group
- type LimitErrGroup
- type ListPartitionRequest
- type ListPartitionResponse
- type RangeOption
- type RangeRequest
- type RangeResponse
- type RangeStreamChan
- type RangeStreamOption
- type RangeStreamRequest
- type StreamRangeResponse
- type UpdateOption
- type UpdateRequest
- type UpdateResponse
- type WatchChan
- type WatchOption
- type WatchRequest
- type WatchResponse
Constants ¶
View Source
const Brain = "brain"
Variables ¶
This section is empty.
Functions ¶
func WithMaxConcurrent ¶
func WithMaxConcurrent(n uint) *withMaxConcurrent
func WithPrefix ¶
func WithPrefix() *withPrefix
func WithRevision ¶
func WithRevision(rev uint64) *withRevision
Types ¶
type Client ¶
type Client interface { // Create stores a new kv Create(ctx context.Context, key, val string, opts ...CreateOption) (*CreateResponse, error) // Update updates value indexed by given key Update(ctx context.Context, key, val string, rev uint64, opts ...UpdateOption) (*UpdateResponse, error) // Get reads single kv Get(ctx context.Context, key string, opts ...GetOption) (*GetResponse, error) // Range reads multiple kvs indexed by keys in [start, end) Range(ctx context.Context, start string, end string, opts ...RangeOption) (*RangeResponse, error) // Delete removes data Delete(ctx context.Context, key string, opts ...DeleteOption) (*DeleteResponse, error) // Compact compacts data Compact(ctx context.Context, rev uint64, opts ...CompactOption) (*CompactResponse, error) // Watch traces event with prefix Watch(ctx context.Context, key string, opts ...WatchOption) WatchChan // RangeStream reads kvs indexed by keys in [start, end) through stream RangeStream(ctx context.Context, start string, end string, opts ...RangeStreamOption) RangeStreamChan // Count counts num of kvs in [start, end) Count(ctx context.Context, start string, end string, opts ...CountOption) (*CountResponse, error) // Close closes client Close() error }
type CompactOption ¶
type CompactOption interface {
// contains filtered or unexported methods
}
type CompactRequest ¶
type CompactRequest rpc.CompactRequest
type CompactResponse ¶
type CompactResponse rpc.CompactResponse
type Config ¶
type Config struct { // Endpoints is a list of URLs Endpoints []string `json:"endpoints"` // TLS is the tls config for handshake with server TLS *tls.Config // LogLevel is the level of info log LogLevel klog.Level `json:"log-level"` // MaxCallSendMsgSize is the client-side request send limit in bytes. // If 0, it defaults to 2.0 MiB (2 * 1024 * 1024). // Make sure that "MaxCallSendMsgSize" < server-side default send/recv limit. MaxCallSendMsgSize int `json:"max-call-send-msg-size"` // MaxCallRecvMsgSize is the client-side response receive limit. // If 0, it defaults to "math.MaxInt32", because range response can // easily exceed request send limits. // Make sure that "MaxCallRecvMsgSize" >= server-side default send/recv limit. MaxCallRecvMsgSize int `json:"max-call-recv-msg-size"` }
Config is the configuration of client
type CountOption ¶
type CountOption interface {
// contains filtered or unexported methods
}
type CountRequest ¶
type CountRequest rpc.CountRequest
type CountResponse ¶
type CountResponse rpc.CountResponse
type CreateOption ¶
type CreateOption interface {
// contains filtered or unexported methods
}
type CreateRequest ¶
type CreateRequest rpc.CreateRequest
type CreateResponse ¶
type CreateResponse rpc.CreateResponse
type DeleteOption ¶
type DeleteOption interface {
// contains filtered or unexported methods
}
type DeleteRequest ¶
type DeleteRequest rpc.DeleteRequest
type DeleteResponse ¶
type DeleteResponse rpc.DeleteResponse
type GetRequest ¶
type GetRequest rpc.GetRequest
type GetResponse ¶
type GetResponse rpc.GetResponse
type LimitErrGroup ¶
type LimitErrGroup struct {
// contains filtered or unexported fields
}
func (*LimitErrGroup) Go ¶
func (g *LimitErrGroup) Go(f func() error)
func (*LimitErrGroup) Wait ¶
func (g *LimitErrGroup) Wait() error
type ListPartitionRequest ¶
type ListPartitionRequest rpc.ListPartitionRequest
type ListPartitionResponse ¶
type ListPartitionResponse rpc.ListPartitionResponse
type RangeOption ¶
type RangeOption interface {
// contains filtered or unexported methods
}
type RangeRequest ¶
type RangeRequest rpc.RangeRequest
type RangeResponse ¶
type RangeResponse rpc.RangeResponse
type RangeStreamChan ¶
type RangeStreamChan <-chan StreamRangeResponse
type RangeStreamOption ¶
type RangeStreamOption interface {
// contains filtered or unexported methods
}
type RangeStreamRequest ¶
type RangeStreamRequest struct { *rpc.RangeRequest // contains filtered or unexported fields }
type StreamRangeResponse ¶
type StreamRangeResponse struct { *RangeResponse // contains filtered or unexported fields }
type UpdateOption ¶
type UpdateOption interface {
// contains filtered or unexported methods
}
type UpdateRequest ¶
type UpdateRequest rpc.UpdateRequest
type UpdateResponse ¶
type UpdateResponse rpc.UpdateResponse
type WatchChan ¶
type WatchChan <-chan WatchResponse
type WatchOption ¶
type WatchOption interface {
// contains filtered or unexported methods
}
type WatchRequest ¶
type WatchRequest rpc.WatchRequest
type WatchResponse ¶
type WatchResponse struct { Header *rpc.ResponseHeader Events []*rpc.Event // contains filtered or unexported fields }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.