Versions in this module Expand all Collapse all v0 v0.2.0 Mar 25, 2022 Changes in this version type Config + HTTPOptions *httpclient.Options v0.1.0 Jan 22, 2021 Changes in this version + const APIFmt + const APIPathKV + const ContentTypeJSON + const FmtOpFailed + const HeaderContentType + const HeaderRevision + const MsgOpFailed + const QueryByLabelsCon + const QueryParamKeyID + const QueryParamMatch + const QueryParamQ + var ErrIDEmpty = errors.New("id is empty") + var ErrKeyNotExist = errors.New("can not find value") + var ErrNoChanges = errors.New("kv has not been changed since last polling") + func ReadBody(resp *http.Response) []byte + type Client struct + func NewClient(config Config) (*Client, error) + func (c *Client) Create(ctx context.Context, kv KVRequest, opts ...OpOption) (*KVDoc, error) + func (c *Client) CurrentRevision() int + func (c *Client) Delete(ctx context.Context, kvIDs string, opts ...OpOption) error + func (c *Client) Get(ctx context.Context, kvID string, opts ...GetOption) (*KVDoc, error) + func (c *Client) List(ctx context.Context, opts ...GetOption) (*KVResponse, int, error) + func (c *Client) Put(ctx context.Context, kv KVRequest, opts ...OpOption) (*KVDoc, error) + type Config struct + DefaultLabels map[string]string + Endpoint string + VerifyPeer bool + type DeleteBody struct + IDs []string + type GetOption func(*GetOptions) + func WithExact() GetOption + func WithGetProject(project string) GetOption + func WithKey(k string) GetOption + func WithLabels(l ...map[string]string) GetOption + func WithRevision(revision int) GetOption + func WithWait(duration string) GetOption + type GetOptions struct + Exact bool + Key string + Labels []map[string]string + Project string + Revision string + Wait string + type KVDoc struct + Checker string + CreatTime int64 + CreateRevision int64 + Domain string + ID string + Key string + Labels map[string]string + Project string + Status string + UpdateRevision int64 + UpdateTime int64 + Value string + ValueType string + type KVRequest struct + Checker string + ID string + Key string + Labels map[string]string + Status string + Value string + ValueType string + type KVResponse struct + Data []*KVDoc + LabelDoc *LabelDocResponse + Total int + type LabelDocResponse struct + Labels map[string]string + type OpOption func(*OpOptions) + func WithProject(project string) OpOption + type OpOptions struct + Project string