agent

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	*Config
	// contains filtered or unexported fields
}

Agent ...

func New

func New(cfg *Config) (*Agent, error)

New returns agent instance

func (*Agent) ApplyRead added in v0.4.7

func (a *Agent) ApplyRead(
	roLevel rkvApi.ConsistencyLevel,
	fn string,
	args ...[]byte) (interface{}, error)

ApplyRead ...

func (*Agent) ApplyWrite added in v0.4.7

func (a *Agent) ApplyWrite(
	fn string,
	args ...[]byte) (interface{}, error)

ApplyWrite ...

func (*Agent) Delete

func (a *Agent) Delete(tab, key []byte) error

Delete ...

func (*Agent) Get

func (a *Agent) Get(
	lvl api.ConsistencyLevel, tab, key []byte) ([]byte, error)

Get ...

func (*Agent) GetApplyFunc added in v0.1.3

func (a *Agent) GetApplyFunc(name string) (dbApi.ApplyFunc, bool, error)

GetApplyFunc ...

func (*Agent) IsLeader added in v0.6.0

func (a *Agent) IsLeader() bool

IsLeader ...

func (*Agent) Leader added in v0.5.5

func (a *Agent) Leader() (string, string)

Leader ...

func (*Agent) Logger added in v0.1.4

func (a *Agent) Logger(subSystem string) *log.Logger

Logger for client use

func (*Agent) Put

func (a *Agent) Put(tab, key, value []byte) error

Put ...

func (*Agent) RegisterApplyRead added in v0.4.3

func (a *Agent) RegisterApplyRead(name string, fn dbApi.ApplyFunc) error

RegisterApplyRead ...

func (*Agent) RegisterApplyWrite added in v0.4.3

func (a *Agent) RegisterApplyWrite(name string, fn dbApi.ApplyFunc) error

RegisterApplyWrite ...

func (*Agent) Shutdown

func (a *Agent) Shutdown() error

Shutdown ...

func (*Agent) UnRegisterApply added in v0.1.3

func (a *Agent) UnRegisterApply(name string) error

UnRegisterApply ...

type Config

type Config struct {
	DataDir  string
	Raft     raft.Config
	BindAddr string // Serf, Raft, RPC address. Serf with port
	RPCPort  int    // rpc API server
	RaftPort int
	BindHTTP string // bind address for HTTP server
	Backend  dbApi.Backend
	NodeName string // Raft server ID
	// Bootstrap should be set to true when starting the first node
	//  of the cluster
	StartJoinAddrs []string
	Bootstrap      bool
	RoutingPolicy  rkvApi.RoutingPolicy
	// Log oprtions: passed configured logger
	Logger log.Logger
	// Or configure options
	// LogLevel: error | warn | info | debug | trace
	LogLevel string
	// LogOutput default - stderr
	LogOutput          io.Writer
	LogIncludeLocation bool
	LogTimeFormat      string
	//
	OnLeaderChangeFn func(isLeader bool)
	//
	Registry rkvApi.ApplyRegistrator
}

Config ...

func (Config) RPCAddr

func (c Config) RPCAddr() (string, error)

RPCAddr returns host:port

func (Config) RaftAddr

func (c Config) RaftAddr() (string, error)

RaftAddr returns host:port

Jump to

Keyboard shortcuts

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