Documentation ¶
Index ¶
- Variables
- type Action
- type Client
- func (c Client) AddAction(id string, action string) error
- func (c Client) GetAction(id string, action string) (Action, error)
- func (c Client) GetLastAction(id string) (LastAction, error)
- func (c Client) SetTrigger(enableAction string, disableAction string, lifetime time.Duration)
- func (c *Client) TriggerStatus(id string, action string) bool
- type DB
- type LastAction
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrActionNotFound = errors.New("action for id not found") ErrUserNotFound = errors.New("id not found") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the wrapper over the concrete transport API
func NewClientCoala ¶
NewClientCoala returns the Client for Coala protocol
func NewClientInMemory ¶
func NewClientInMemory() Client
NewClientInMemory returns the Client working without backend
func (Client) GetLastAction ¶
func (c Client) GetLastAction(id string) (LastAction, error)
GetLastAction gets information about any last action of this id
func (Client) SetTrigger ¶
SetTrigger sets the state tracking on the client by id, per enableAction action, which can be disable via disableAction
type DB ¶
type DB interface { AddAction(id interface{}, actionName string) error GetAction(id interface{}, actionName string) (Action, error) GetLastAction(id interface{}) (LastAction, error) }
DB is abstract database interface for different usage cases
func NewMongoDB ¶
NewMongoDB returns implemetation of DB interface for MongoDB
func NewWithoutDB ¶
func NewWithoutDB() DB
NewWithoutDB create an empty instance that does not write and does not read anything
type LastAction ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.