diskStore

package
v0.0.0-...-250bf39 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2017 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 MessageValue

type MessageValue struct {
	Operation  MessageValue_OPERATION `json:"operation,omitempty"`
	Key        string                 `json:"key,omitempty"`
	Value      string                 `json:"value,omitempty"`
	Expiration int64                  `json:"expiration,omitempty"`
	// contains filtered or unexported fields
}

type MessageValue_OPERATION

type MessageValue_OPERATION int32
const (
	MessageValue_CAS MessageValue_OPERATION = 0
)

type Store

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

func New

func New(storagePath string, raftAddress string, singleMode bool) *Store

New returns a new Store.

func (*Store) CheckNSet

func (s *Store) CheckNSet(key string, value string, expiration time.Time) (bool, string, error)

func (*Store) Count

func (s *Store) Count() int

func (*Store) IsLeader

func (s *Store) IsLeader() bool

func (*Store) Join

func (s *Store) Join(addr string) error

func (*Store) Open

func (s *Store) Open() error

type UniqueStorage

type UniqueStorage struct {
	Items map[string]*UniqueStorageValue `json:"items,omitempty"`
}

func (*UniqueStorage) Persist

func (f *UniqueStorage) Persist(sink raft.SnapshotSink) error

func (*UniqueStorage) Release

func (f *UniqueStorage) Release()

type UniqueStorageValue

type UniqueStorageValue struct {
	Value      string `json:"value,omitempty"`
	Expiration int64  `json:"expiration,omitempty"`
}

Jump to

Keyboard shortcuts

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