storage

package
v1.0.22 Latest Latest
Warning

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

Go to latest
Published: May 1, 2017 License: BSD-3-Clause, BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	User    gregor.UID
	Device  gregor.DeviceID
	Sm      gregor.StateMachine
	Storage LocalStorageEngine
	Log     rpc.LogOutput

	SaveTimer <-chan time.Time
}

func NewClient

func NewClient(user gregor.UID, device gregor.DeviceID, sm gregor.StateMachine,
	storage LocalStorageEngine, saveInterval time.Duration, log rpc.LogOutput) *Client

func (*Client) InBandMessagesFromState

func (c *Client) InBandMessagesFromState(s gregor.State) ([]gregor.InBandMessage, error)

func (*Client) Restore

func (c *Client) Restore() error

func (*Client) Save

func (c *Client) Save() error

func (*Client) State

func (c *Client) State(cli gregor1.IncomingInterface) (res gregor.State, err error)

func (*Client) StateMachineConsumeMessage

func (c *Client) StateMachineConsumeMessage(m gregor1.Message) error

func (*Client) StateMachineInBandMessagesSince

func (c *Client) StateMachineInBandMessagesSince(t time.Time) ([]gregor.InBandMessage, error)

func (*Client) StateMachineLatestCTime

func (c *Client) StateMachineLatestCTime() *time.Time

func (*Client) StateMachineState

func (c *Client) StateMachineState(t gregor.TimeOrOffset) (gregor.State, error)

func (*Client) Sync

func (*Client) SyncFromTime

func (c *Client) SyncFromTime(cli gregor1.IncomingInterface, t *time.Time, syncResult *gregor1.SyncResult) (msgs []gregor.InBandMessage, err error)

type ErrHashMismatch

type ErrHashMismatch struct{}

func (ErrHashMismatch) Error

func (e ErrHashMismatch) Error() string

type LocalStorageEngine

type LocalStorageEngine interface {
	Store(gregor.UID, []byte) error
	Load(gregor.UID) ([]byte, error)
}

Jump to

Keyboard shortcuts

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