store

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2018 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) *bool

func Int

func Int(i int64) *int64

func Randstr

func Randstr(len int) string

func String

func String(s string) *string

func Time

func Time(t time.Time) *time.Time

func Token

func Token() string

Types

type Store

type Store interface {
	// Persist persists an event and returns its ID.
	Persist(eventType string, data string) (int64, error)
	// State returns the current state.
	State() (*models.State, error)
	// Migrate migrates the database schema to the latest available version.
	Migrate() error
	// Ping checks the contnectivity with the store.
	Ping() error
	// Reset removes all stored data.
	Reset() error
}

Store describes a data store.

func NewMySQLStore

func NewMySQLStore(username, password, host, port, dbname string) (Store, error)

NewMySQLStore creates a new store that uses MySQL as a backend.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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