persist

package
v0.0.0-...-855de17 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadgerPersistence

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

func (BadgerPersistence) Close

func (b BadgerPersistence) Close()

func (BadgerPersistence) GetOwner

func (b BadgerPersistence) GetOwner(name string) (o *remote.Owner, err error)

func (BadgerPersistence) GetOwners

func (b BadgerPersistence) GetOwners() (owners []*remote.Owner, err error)

func (BadgerPersistence) GetRepoOutcome

func (b BadgerPersistence) GetRepoOutcome(r *remote.RepoT) (outcome *remote.Outcome, err error)

func (BadgerPersistence) GetRepos

func (b BadgerPersistence) GetRepos(withOutcome func(outcome *remote.Outcome) (matching bool)) (repos []*remote.RepoT, err error)

func (BadgerPersistence) GetStateLeafs

func (b BadgerPersistence) GetStateLeafs() (state PersistentState, err error)

func (BadgerPersistence) PutCurrentLeaf

func (b BadgerPersistence) PutCurrentLeaf(leaf remote.Leaf, changeState func(st *PersistentState, l remote.Leaf)) (state PersistentState, err error)

func (BadgerPersistence) PutOwner

func (b BadgerPersistence) PutOwner(o *remote.Owner) (err error)

func (BadgerPersistence) PutRepoOutcome

func (b BadgerPersistence) PutRepoOutcome(r *remote.RepoT, outcome *remote.Outcome) (err error)

func (BadgerPersistence) SetGenesis

func (b BadgerPersistence) SetGenesis(leaf remote.Leaf) (err error)

type ErrKeyNotFound

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

type PersistenceConfig

type PersistenceConfig struct {
	Name     string // eg. bolt, kf, POST
	Endpoint string // eg. path/to/database or HTTP endpoint
}

type PersistenceProvider

type PersistenceProvider interface {
	PutRepoOutcome(r *remote.RepoT, outcome *remote.Outcome) error
	GetRepoOutcome(r *remote.RepoT) (outcome *remote.Outcome, err error)

	PutOwner(o *remote.Owner) error
	GetOwner(name string) (owner *remote.Owner, err error)
	GetOwners() (owners []*remote.Owner, err error)

	GetRepos(withOutcome func(outcome *remote.Outcome) (matching bool)) (repos []*remote.RepoT, err error)

	SetGenesis(leaf remote.Leaf) error
	PutCurrentLeaf(leaf remote.Leaf, updater func(st *PersistentState, l remote.Leaf)) (state PersistentState, err error)
	GetStateLeafs() (state PersistentState, err error)

	Close()
}

type PersistentState

type PersistentState struct {
	Genesis  remote.Leaf
	Last     remote.Leaf
	Current  remote.Leaf
	Distance int
	Steps    int64 // ha
}

func (PersistentState) IsGenesis

func (ps PersistentState) IsGenesis() bool

func (PersistentState) String

func (ps PersistentState) String() string

type RetrospectiveProvider

type RetrospectiveProvider interface {
	GetOutcomes(outcome remote.Outcome) (repos []*remote.RepoT, err error)
	Close()
}

Jump to

Keyboard shortcuts

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