storage

package
v1.0.39 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2017 License: BSD-3-Clause, BSD-3-Clause Imports: 9 Imported by: ? 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

func FilterFutureDismissals

func FilterFutureDismissals(msgs []gregor.InBandMessage,
	allmsgs map[string]gregor.InBandMessage, cutoff time.Time) []gregor.InBandMessage

Types

type LocalDb added in v1.0.39

type LocalDb struct {
	libkb.Contextified
}

func NewLocalDB added in v1.0.39

func NewLocalDB(g *libkb.GlobalContext) *LocalDb

func (*LocalDb) Load added in v1.0.39

func (db *LocalDb) Load(u gregor.UID) (state []byte, localDismissals [][]byte, err error)

func (*LocalDb) Store added in v1.0.39

func (db *LocalDb) Store(u gregor.UID, state []byte, localDismissals [][]byte) error

type MemEngine

type MemEngine struct {
	sync.Mutex
	// contains filtered or unexported fields
}

MemEngine is an implementation of a gregor StateMachine that just keeps all incoming messages in a hash table, with one entry per user. It doesn't do anything fancy w/r/t indexing Items, so just iterates over all of them every time a dismissal or a state dump comes in. Used mainly for testing when SQLite isn't available.

func NewMemEngine

func NewMemEngine(f gregor.ObjFactory, cl clockwork.Clock, log logger.Logger) *MemEngine

NewMemEngine makes a new MemEngine with the given object factory and the potentially fake clock (or a real clock if not testing).

func (*MemEngine) Clear

func (m *MemEngine) Clear() error

func (*MemEngine) Clock

func (m *MemEngine) Clock() clockwork.Clock

func (*MemEngine) ConsumeLocalDismissal added in v1.0.39

func (m *MemEngine) ConsumeLocalDismissal(ctx context.Context, u gregor.UID, msgID gregor.MsgID) error

func (*MemEngine) ConsumeMessage

func (m *MemEngine) ConsumeMessage(ctx context.Context, msg gregor.Message) (time.Time, error)

func (*MemEngine) DeleteReminder

func (m *MemEngine) DeleteReminder(ctx context.Context, r gregor.ReminderID) error

func (*MemEngine) InBandMessagesSince

func (m *MemEngine) InBandMessagesSince(ctx context.Context, u gregor.UID, d gregor.DeviceID, t time.Time) ([]gregor.InBandMessage, error)

func (*MemEngine) InitLocalDismissals added in v1.0.39

func (m *MemEngine) InitLocalDismissals(ctx context.Context, u gregor.UID, msgIDs []gregor.MsgID) error

func (*MemEngine) InitState

func (m *MemEngine) InitState(s gregor.State) error

func (*MemEngine) IsEphemeral

func (m *MemEngine) IsEphemeral() bool

func (*MemEngine) LatestCTime

func (m *MemEngine) LatestCTime(ctx context.Context, u gregor.UID, d gregor.DeviceID) *time.Time

func (*MemEngine) LocalDismissals added in v1.0.39

func (m *MemEngine) LocalDismissals(ctx context.Context, u gregor.UID) (res []gregor.MsgID, err error)

func (*MemEngine) ObjFactory

func (m *MemEngine) ObjFactory() gregor.ObjFactory

func (*MemEngine) ReminderLockDuration

func (m *MemEngine) ReminderLockDuration() time.Duration

func (*MemEngine) Reminders

func (m *MemEngine) Reminders(ctx context.Context, maxReminders int) (gregor.ReminderSet, error)

func (*MemEngine) State

func (*MemEngine) StateByCategoryPrefix

func (m *MemEngine) StateByCategoryPrefix(ctx context.Context, u gregor.UID, d gregor.DeviceID, t gregor.TimeOrOffset, cp gregor.Category) (gregor.State, error)

Jump to

Keyboard shortcuts

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