storage

package
v5.4.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: BSD-3-Clause, BSD-3-Clause Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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     logger.Logger

	// testing events
	TestingEvents *TestingEvents
	// contains filtered or unexported fields
}

func NewClient

func NewClient(user gregor.UID, device gregor.DeviceID, createSm func() gregor.StateMachine,
	storage LocalStorageEngine, incomingClient func() gregor1.IncomingInterface, log logger.Logger, clock clockwork.Clock) *Client

func (*Client) ConsumeMessage

func (c *Client) ConsumeMessage(ctx context.Context, m gregor.Message) error

func (*Client) InBandMessagesFromState

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

func (*Client) Restore

func (c *Client) Restore(ctx context.Context) error

func (*Client) Save

func (c *Client) Save(ctx context.Context) error

func (*Client) State

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

func (*Client) StateMachineConsumeLocalDismissal added in v1.0.39

func (c *Client) StateMachineConsumeLocalDismissal(ctx context.Context, id gregor.MsgID) error

func (*Client) StateMachineConsumeMessage

func (c *Client) StateMachineConsumeMessage(ctx context.Context, m gregor1.Message) error

func (*Client) StateMachineInBandMessagesSince

func (c *Client) StateMachineInBandMessagesSince(ctx context.Context, t time.Time, filterLocalDismissals bool) ([]gregor.InBandMessage, error)

func (*Client) StateMachineLatestCTime

func (c *Client) StateMachineLatestCTime(ctx context.Context) *time.Time

func (*Client) StateMachineState

func (c *Client) StateMachineState(ctx context.Context, t gregor.TimeOrOffset,
	applyLocalState bool) (gregor.State, error)

func (*Client) Stop

func (c *Client) Stop() chan struct{}

func (*Client) Sync

func (*Client) SyncFromTime

func (c *Client) SyncFromTime(ctx context.Context, 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(uid gregor.UID, state []byte, outbox [][]byte, localdismissals [][]byte) error
	Load(uid gregor.UID) (state []byte, outbox [][]byte, localdismissals [][]byte, err error)
}

type TestingEvents

type TestingEvents struct {
	OutboxSend chan gregor1.Message
}

func NewTestingEvents

func NewTestingEvents() *TestingEvents

Jump to

Keyboard shortcuts

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