storage

package
Version: v0.0.0-...-fc1e718 Latest Latest
Warning

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

Go to latest
Published: May 10, 2017 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RestoreStorage

func RestoreStorage(diskPath string, maxLength int, appConfig string) (bool, int, *consensus.Log, int, *app.StateMachine)

Types

type FileStorage

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

func MakeFileStorage

func MakeFileStorage(diskPath string, persistenceMode string) (*FileStorage, error)

MakeFileStorage opens the files for persistent storage

func (*FileStorage) PersistLogUpdate

func (fs *FileStorage) PersistLogUpdate(log msgs.LogUpdate) error

PersistLogUpdate writes the specified log update to persistent storage Function returns when write+sync is completed Error is returned if it was not possible to write

func (*FileStorage) PersistSnapshot

func (fs *FileStorage) PersistSnapshot(index int, bytes []byte) error

PersistSnapshot writes the provided snapshot to persistent storage index should be the index of the last request applied to be state machine before snapshoting

func (*FileStorage) PersistView

func (fs *FileStorage) PersistView(view int) error

PersistView writes view update to persistent storage Function returns when write+sync is completed Error is returned if it was not possible to write

Jump to

Keyboard shortcuts

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