Documentation ¶
Index ¶
- func IsNotFoundError(err error) bool
- func NewNotFoundError(tableName string, key string, value interface{}) error
- type Named
- type NotFound
- type Schema
- type Store
- func (s *Store) Read(table string, key string, value interface{}) (interface{}, error)
- func (s *Store) Remove(table string, key string, value interface{}) error
- func (s *Store) Write(table string, objs ...interface{}) error
- func (s *Store) WriteAndBlock(table string, objs ...interface{}) (Transaction, error)
- type Table
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotFoundError ¶
IsNotFoundError checks if an error is of type notFound
func NewNotFoundError ¶
NewNotFoundError return a not found error for the given input
Types ¶
type NotFound ¶
type NotFound struct {
Msg string
}
NotFound is a custom error that is returned when no item can be found
type Schema ¶
type Schema interface { AddToSchema(table Table) // contains filtered or unexported methods }
Schema represents the db schema
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is used to connect to the database
func (*Store) WriteAndBlock ¶
func (s *Store) WriteAndBlock(table string, objs ...interface{}) (Transaction, error)
WriteAndBlock writes to the store but block any other writing until the returned function is called
type Table ¶
type Table interface { Named GetTableSchema() *memdb.TableSchema }
Table represents the name and schema of a DB
type Transaction ¶
Transaction represents the open DB transaction
Click to show internal directories.
Click to hide internal directories.