api

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Put(tab, key, value []byte) error
	Get(level rkvApi.ConsistencyLevel, tab, key []byte) ([]byte, error)
	Delete(tab, key []byte) error
	Batch([]*dbApi.BatchEntry) (interface{}, error)

	ApplyFuncRead(roLevel rkvApi.ConsistencyLevel,
		fn string,
		args ...[]byte) (interface{}, error)
	ApplyFuncWrite(fn string,
		args ...[]byte) (interface{}, error)

	dbApi.Closer
}

Backend interface for disctributed database

type Cluster

type Cluster interface {
	WaitForLeader(time.Duration) error
	IsLeader() bool
	Leader() (host, ip string)
	Servers() ([]*Server, error)
	Restarted() bool
}

Cluster interface for distributed service

type Server

type Server struct {
	ID           string `json:"id"`
	IP           string `json:"ip"`
	Host         string `json:"host"`
	RaftPort     string `json:"raft-port"`
	RPCPort      string `json:"rpc-port"`
	HTTPBindAddr string `json:"http-bind-addr"`
	SerfBindAddr string `json:"serf-bind-addr"`
	IsLeader     bool   `json:"leader"`
	Online       bool   `json:"online"`
	IsLocal      bool   `json:"local"`
}

Server describes cluster server

Jump to

Keyboard shortcuts

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