MCPcopy
hub / github.com/grafana/dskit / NewClient

Function NewClient

kv/memberlist/memberlist_client.go:50–60  ·  view source on GitHub ↗

NewClient creates new client instance. Supplied codec must already be registered in KV.

(kv *KV, codec codec.Codec)

Source from the content-addressed store, hash-verified

48
49// NewClient creates new client instance. Supplied codec must already be registered in KV.
50func NewClient(kv *KV, codec codec.Codec) (*Client, error) {
51 c := kv.GetCodec(codec.CodecID())
52 if c == nil {
53 return nil, fmt.Errorf("codec not registered in KV: %s", codec.CodecID())
54 }
55
56 return &Client{
57 kv: kv,
58 codec: codec,
59 }, nil
60}
61
62// List is part of kv.Client interface.
63func (c *Client) List(ctx context.Context, prefix string) ([]string, error) {

Callers 15

runClusterFunction · 0.92
runClientFunction · 0.92
createClientFunction · 0.92
TestBasicGetAndCasFunction · 0.70
withFixturesFunction · 0.70
TestMultipleCASFunction · 0.70
TestDeleteFunction · 0.70
TestMultipleCodecsFunction · 0.70

Calls 3

ErrorfMethod · 0.80
CodecIDMethod · 0.65
GetCodecMethod · 0.45