gclient

package
v0.0.0-...-b371d68 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GrpcClient

func GrpcClient(cf *GrpcConfig, def *Defaults) (acproto.ACrpcClient, func(), error)

Types

type C

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

func New

func New(cf *GrpcConfig) (*C, error)

func (*C) Close

func (c *C) Close()

func (*C) Get

func (c *C) Get(d *Datum) (*Datum, error)

func (*C) GetRange

func (c *C) GetRange(mapname string, key0 string, key1 string, ver0 uint64, ver1 uint64) ([]*Datum, error)

func (*C) GetRingConf

func (c *C) GetRingConf(db string, dc string) (*RingConf, error)

func (*C) GetServersAll

func (c *C) GetServersAll() ([]*info.Server, error)

func (*C) GetServersInfo

func (c *C) GetServersInfo(sys string, env string, host string, dc string, id string) ([]*info.Server, error)

func (*C) MGet

func (c *C) MGet(d []*Datum) ([]*Datum, error)

func (*C) Put

func (c *C) Put(d *Datum) (int, error)

func (*C) RPC

func (c *C) RPC() acproto.ACrpcClient

type Datum

type Datum struct {
	Map       string
	Key       string
	Value     []byte
	Version   uint64
	Expire    uint64
	IfVersion uint64
	Shard     uint32
	HaveShard bool
}

type Defaults

type Defaults struct {
	TLS *tls.Config
}

type GrpcConfig

type GrpcConfig struct {
	Addr    []string
	Timeout time.Duration
	TLS     *tls.Config
}

type RingConf

type RingConf struct {
	Vers   uint64
	Stable bool
	DB     string
	DC     string
	Part   []RingShard
}

type RingShard

type RingShard struct {
	Shard  uint32
	Server []string
}

Jump to

Keyboard shortcuts

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