store

package
v0.0.0-...-7aebad0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: Apache-2.0 Imports: 12 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 {
	// contains filtered or unexported fields
}

Store is a simple key-value store, where all changes are made via Raft consensus.

func New

func New() *Store

New returns a new Store.

func (*Store) Delete

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

Delete deletes the given key.

func (*Store) Get

func (s *Store) Get(key string) (interface{}, error)

Get returns the value for the given key.

func (*Store) ObservationCh

func (s *Store) ObservationCh() chan raft.Observation

ObservationCh retrieves the channel where cluster changes are reported

func (*Store) Open

func (s *Store) Open(nodeID string, stateDir string, kvStore string, raftBindAddrPort string, raftAdvertiseAddrPort string, peers string, logger hclog.Logger) error

Open opens the store. If peers is empty then this node becomes the first node, and therefore leader, of the cluster.

func (*Store) Set

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

Set sets the value for the given key.

Jump to

Keyboard shortcuts

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