Documentation
¶
Index ¶
- Variables
- func MockClear()
- func MockOpen() (db.Store, error)
- type APIContext
- func (c APIContext) DeleteHostData(hostKey string) error
- func (c APIContext) HostData(hostKey string, value interface{}) error
- func (c APIContext) ModuleContext() (string, error)
- func (c APIContext) SetHostData(hostKey string, value interface{}) error
- func (c APIContext) SetModuleContext(value string) error
- type Context
- type DBOpenFunc
- type MockStore
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorContextNotFound = errors.New("unable to find specified context") ErrorKeyNotFound = errors.New("unable to find the specified key") ErrorInvalidKey = errors.New("invalid key specified. Key can not be empty") ErrorInvalidValue = errors.New("invalid value specified. Value can not be nil") )
View Source
var DefaultDBOpenFunc = db.Open
View Source
var ErrorExpected = errors.New("expected error")
Functions ¶
Types ¶
type APIContext ¶
type APIContext struct {
// contains filtered or unexported fields
}
func (APIContext) DeleteHostData ¶
func (c APIContext) DeleteHostData(hostKey string) error
func (APIContext) HostData ¶
func (c APIContext) HostData(hostKey string, value interface{}) error
func (APIContext) ModuleContext ¶
func (c APIContext) ModuleContext() (string, error)
func (APIContext) SetHostData ¶
func (c APIContext) SetHostData(hostKey string, value interface{}) error
func (APIContext) SetModuleContext ¶
func (c APIContext) SetModuleContext(value string) error
type Context ¶
type Context interface { ModuleContext() (string, error) SetModuleContext(value string) error HostData(hostKey string, value interface{}) error SetHostData(hostKey string, data interface{}) error DeleteHostData(hostKey string) error }
func NewWithDB ¶
func NewWithDB(contextKey string, dbOpen DBOpenFunc) Context
type DBOpenFunc ¶
Click to show internal directories.
Click to hide internal directories.