service

package
v0.0.0-...-9babf30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const KVDBServiceName = "KVDB"

Variables

This section is empty.

Functions

func DialKVDBService

func DialKVDBService(network, address string) (kvdb.KVDB, error)

Types

type CleanupRequest

type CleanupRequest struct{}

type CleanupResponse

type CleanupResponse struct{}

type DeleteMultiRequest

type DeleteMultiRequest struct {
	Keys    []string      `json:"keys"`
	Deleter *kvdb.Deleter `json:"deleter"`
}

type DeleteMultiResponse

type DeleteMultiResponse struct{}

type DeleteRequest

type DeleteRequest struct {
	Key     string        `json:"key"`
	Deleter *kvdb.Deleter `json:"deleter"`
}

type DeleteResponse

type DeleteResponse struct{}

type ExistRequest

type ExistRequest struct {
	Key string `json:"key"`
}

type ExistResponse

type ExistResponse struct {
	Has bool `json:"has"`
}

type GetMultiRequest

type GetMultiRequest struct {
	Keys   []string     `json:"keys"`
	Getter *kvdb.Getter `json:"getter"`
}

type GetMultiResponse

type GetMultiResponse struct {
	NodeMap map[string]kvdb.Node `json:"nodeMap"`
}

type GetRequest

type GetRequest struct {
	Key    string       `json:"key"`
	Getter *kvdb.Getter `json:"getter"`
}

type GetResponse

type GetResponse struct {
	Node *kvdb.Node `json:"node"`
}

type KVDBClient

type KVDBClient struct {
	// contains filtered or unexported fields
}

func (*KVDBClient) Cleanup

func (c *KVDBClient) Cleanup() error

func (*KVDBClient) Close

func (c *KVDBClient) Close() error

func (*KVDBClient) Delete

func (c *KVDBClient) Delete(key string, opts ...kvdb.DeleteOption) error

func (*KVDBClient) DeleteMulti

func (c *KVDBClient) DeleteMulti(keys []string, opts ...kvdb.DeleteOption) error

func (*KVDBClient) Exist

func (c *KVDBClient) Exist(key string) (bool, error)

func (*KVDBClient) Get

func (c *KVDBClient) Get(key string, opts ...kvdb.GetOption) (*kvdb.Node, error)

func (*KVDBClient) GetMulti

func (c *KVDBClient) GetMulti(keys []string, opts ...kvdb.GetOption,
) (map[string]kvdb.Node, error)

func (*KVDBClient) Set

func (c *KVDBClient) Set(key, value string, opts ...kvdb.SetOption) error

func (*KVDBClient) SetMulti

func (c *KVDBClient) SetMulti(kvPairs []string, opts ...kvdb.SetOption) error

type KVDBInterface

type KVDBInterface interface {
	Get(req GetRequest, resp *GetResponse) error
	GetMulti(req GetMultiRequest, resp *GetMultiResponse) error
	Set(req SetRequest, resp *SetResponse) error
	SetMulti(req SetMultiRequest, resp *SetMultiResponse) error
	Delete(req DeleteRequest, resp *DeleteResponse) error
	DeleteMulti(req DeleteMultiRequest, resp *DeleteMultiResponse) error
	Exist(req ExistRequest, resp *ExistResponse) error
	Cleanup(req CleanupRequest, resp *CleanupResponse) error
}

type SetMultiRequest

type SetMultiRequest struct {
	KvPairs []string     `json:"kvPairs"`
	Setter  *kvdb.Setter `json:"setter"`
}

type SetMultiResponse

type SetMultiResponse struct{}

type SetRequest

type SetRequest struct {
	Key    string       `json:"key"`
	Value  string       `json:"value"`
	Setter *kvdb.Setter `json:"setter"`
}

type SetResponse

type SetResponse struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL