state

package
v0.4.19 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyedStorage

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

func NewKeyedStorage

func NewKeyedStorage(key string, storage *Storage) *KeyedStorage

func (*KeyedStorage) Load

func (m *KeyedStorage) Load(value interface{}) (bool, error)

func (*KeyedStorage) Save

func (m *KeyedStorage) Save(value interface{}) error

type Storage

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

func NewState

func NewState(ctx context.Context, cfg *StorageConfig) (*Storage, error)

func (*Storage) HardwareHash

func (s *Storage) HardwareHash() string

func (*Storage) HardwareWithBenchmarks

func (s *Storage) HardwareWithBenchmarks() *hardware.Hardware

func (*Storage) Load

func (s *Storage) Load(key string, value interface{}) (bool, error)

func (*Storage) PassedBenchmarks

func (s *Storage) PassedBenchmarks() map[uint64]bool

func (*Storage) Remove

func (s *Storage) Remove(key string) (bool, error)

func (*Storage) Save

func (s *Storage) Save(key string, value interface{}) error

func (*Storage) SetHardwareHash

func (s *Storage) SetHardwareHash(v string) error

func (*Storage) SetHardwareWithBenchmarks

func (s *Storage) SetHardwareWithBenchmarks(hw *hardware.Hardware) error

func (*Storage) SetPassedBenchmarks

func (s *Storage) SetPassedBenchmarks(v map[uint64]bool) error

type StorageConfig

type StorageConfig struct {
	Endpoint string `yaml:"endpoint" required:"true" default:"/var/lib/sonm/worker.boltdb"`
	Bucket   string `yaml:"bucket" required:"true" default:"sonm"`
}

Jump to

Keyboard shortcuts

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