Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigFilename(configroot string) (string, error)
- func Init(repoPath, swarmPort string) error
- type Datastore
- type FSRepo
- func (r *FSRepo) Close() error
- func (r *FSRepo) Config() (*config.Config, error)
- func (r *FSRepo) Datastore() Datastore
- func (r *FSRepo) Matrix() *matrix.MatrixKeeper
- func (r *FSRepo) Path() string
- func (r *FSRepo) SetState() error
- func (r *FSRepo) State() *bloom.BloomFilter
- func (r *FSRepo) StateKeeper() *StateKeeper
- type Repo
- type State
- type StateKeeper
Constants ¶
View Source
const (
// Root location of the repository
Root = ".datahop"
)
Variables ¶
View Source
var (
ErrorRepoClosed = errors.New("cannot access config, repo not open")
)
Functions ¶
func ConfigFilename ¶
ConfigFilename returns the configuration file path given a configuration root directory. If the configuration root directory is empty, use the default one
Types ¶
type FSRepo ¶
FSRepo implements Repo
func (*FSRepo) Matrix ¶ added in v0.0.11
func (r *FSRepo) Matrix() *matrix.MatrixKeeper
Matrix returns nodes matrix
func (*FSRepo) State ¶
func (r *FSRepo) State() *bloom.BloomFilter
State returns nodes crdt bloom filter state
func (*FSRepo) StateKeeper ¶ added in v0.0.16
func (r *FSRepo) StateKeeper() *StateKeeper
StateKeeper returns nodes matrix
type Repo ¶
type Repo interface { Path() string Config() (*config.Config, error) Datastore() Datastore Close() error State() *bloom.BloomFilter SetState() error Matrix() *matrix.MatrixKeeper StateKeeper() *StateKeeper }
Repo exposes basic repo operations
type StateKeeper ¶ added in v0.0.16
type StateKeeper struct {
// contains filtered or unexported fields
}
func LoadStateKeeper ¶ added in v0.0.16
func LoadStateKeeper(root string) (*StateKeeper, error)
func (*StateKeeper) AddOrUpdateState ¶ added in v0.0.16
func (s *StateKeeper) AddOrUpdateState(name string, membership bool, deltas []string) (*bloom.BloomFilter, error)
func (*StateKeeper) GetState ¶ added in v0.0.16
func (s *StateKeeper) GetState(name string) (*State, error)
func (*StateKeeper) GetStates ¶ added in v0.0.16
func (s *StateKeeper) GetStates() map[string]*State
func (*StateKeeper) SaveStates ¶ added in v0.0.16
func (s *StateKeeper) SaveStates() (map[string]*State, error)
Click to show internal directories.
Click to hide internal directories.