storage

package
v0.0.0-...-f6cd02a Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2016 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadScan = errors.New("bad scan of data type")
View Source
var ErrBadString = errors.New("expected either a string or a []byte")

Functions

func Schema

func Schema(engine string) []string

Types

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) *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) ConsumeMessage

func (m *MemEngine) ConsumeMessage(msg gregor.Message) error

func (*MemEngine) InBandMessagesSince

func (m *MemEngine) InBandMessagesSince(u gregor.UID, d gregor.DeviceID, t gregor.TimeOrOffset) ([]gregor.InBandMessage, error)

func (*MemEngine) State

type SQLEngine

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

func NewSQLEngine

func NewSQLEngine(d *sql.DB, of gregor.ObjFactory, stw sqlTimeWriter, cl clockwork.Clock) *SQLEngine

func (*SQLEngine) ConsumeMessage

func (s *SQLEngine) ConsumeMessage(m gregor.Message) error

func (*SQLEngine) InBandMessagesSince

func (s *SQLEngine) InBandMessagesSince(u gregor.UID, d gregor.DeviceID, t gregor.TimeOrOffset) ([]gregor.InBandMessage, error)

func (*SQLEngine) State

Jump to

Keyboard shortcuts

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