store

package
v0.0.0-...-a7eec1d Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	RaftID      string
	RaftDir     string
	BindAddress string
	Logger      hclog.Logger

	// ResponseTimeout is the duration after which a non-reachable node is removed
	ResponseTimeout time.Duration
	// contains filtered or unexported fields
}

func NewStore

func NewStore(dir, address string, logger hclog.Logger) *Store

func (*Store) Delete

func (s *Store) Delete(key string) error

func (*Store) Get

func (s *Store) Get(key string) (string, error)

func (*Store) IsLeader

func (s *Store) IsLeader() bool

func (*Store) Join

func (s *Store) Join(nodeID, nodeAddress string) error

func (*Store) LeadershipTransfer

func (s *Store) LeadershipTransfer() error

func (*Store) Nodes

func (s *Store) Nodes() ([]raft.Server, error)

func (*Store) Set

func (s *Store) Set(key, value string) error

func (*Store) Start

func (s *Store) Start(id string, bootstrap bool) error

func (*Store) Stop

func (s *Store) Stop() error

Jump to

Keyboard shortcuts

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