Documentation ¶
Overview ¶
Package sus provides data storage for entities that require sequential updates. Any type of datastore can be created in the same manner as those available by default in sus, Memory/File/AppEngine.
Index ¶
- type ByteGetter
- type BytePutter
- type DeleteMulti
- type Deleter
- type EntityInitializer
- type GetMulti
- type IdFactory
- type IsNonExtantError
- type Marshaler
- type PutMulti
- type RunInTransaction
- type Store
- func NewFileStore(storeDir string, fileExt string, m Marshaler, un Unmarshaler, idf IdFactory, ...) (Store, error)
- func NewJsonFileStore(storeDir string, idf IdFactory, vf VersionFactory, ei EntityInitializer) (Store, error)
- func NewJsonMemoryStore(idf IdFactory, vf VersionFactory, ei EntityInitializer) Store
- func NewMemoryStore(m Marshaler, un Unmarshaler, idf IdFactory, vf VersionFactory, ...) Store
- func NewMutexByteStore(bg ByteGetter, bp BytePutter, d Deleter, m Marshaler, un Unmarshaler, ...) Store
- func NewStore(gm GetMulti, pm PutMulti, dm DeleteMulti, idf IdFactory, vf VersionFactory, ...) Store
- type Transaction
- type Unmarshaler
- type Version
- type VersionFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteGetter ¶
type BytePutter ¶
type DeleteMulti ¶
type EntityInitializer ¶
type IsNonExtantError ¶
type RunInTransaction ¶
type RunInTransaction func(tran Transaction) error
type Store ¶
type Store interface { Create() (id string, v Version, err error) CreateMulti(count uint) (ids []string, vs []Version, err error) Read(id string) (v Version, err error) ReadMulti(ids []string) (vs []Version, err error) Update(id string, v Version) error UpdateMulti(ids []string, vs []Version) error Delete(id string) error DeleteMulti(ids []string) error }
The core sus interface.
func NewFileStore ¶
func NewFileStore(storeDir string, fileExt string, m Marshaler, un Unmarshaler, idf IdFactory, vf VersionFactory, ei EntityInitializer) (Store, error)
Creates and configures a store that stores entities by converting them to and from []byte and keeps them in the local file system.
func NewJsonFileStore ¶
func NewJsonFileStore(storeDir string, idf IdFactory, vf VersionFactory, ei EntityInitializer) (Store, error)
Creates and configures a store that stores entities by converting them to and from json []byte data and keeps them in the local file system.
func NewJsonMemoryStore ¶
func NewJsonMemoryStore(idf IdFactory, vf VersionFactory, ei EntityInitializer) Store
Creates and configures a store that stores entities by converting them to and from json []byte data and keeps them in the local system memory.
func NewMemoryStore ¶
func NewMemoryStore(m Marshaler, un Unmarshaler, idf IdFactory, vf VersionFactory, ei EntityInitializer) Store
Creates and configures a store that stores entities by converting them to and from []byte and keeps them in the local system memory.
func NewMutexByteStore ¶
func NewMutexByteStore(bg ByteGetter, bp BytePutter, d Deleter, m Marshaler, un Unmarshaler, idf IdFactory, vf VersionFactory, ei EntityInitializer, inee IsNonExtantError) Store
Creates and configures a store that stores entities by converting them to and from []byte and ensures versioning correctness with mutex locks.
func NewStore ¶
func NewStore(gm GetMulti, pm PutMulti, dm DeleteMulti, idf IdFactory, vf VersionFactory, ei EntityInitializer, inee IsNonExtantError, rit RunInTransaction) Store
Create and configure a core store.
type Transaction ¶
type Transaction func() error
type Unmarshaler ¶
type Version ¶
type Version interface { GetVersion() int IncrementVersion() DecrementVersion() }
The interface that struct entities must include as anonymous fields in order to be used with sus stores.
type VersionFactory ¶
type VersionFactory func() Version
Directories ¶
Path | Synopsis |
---|---|
Godeps
|
|
_workspace/src/github.com/stretchr/testify/assert
A set of comprehensive testing tools for use with the normal Go testing system.
|
A set of comprehensive testing tools for use with the normal Go testing system. |