Documentation
¶
Index ¶
- Variables
- func AssetPending(md5 string) (bool, error)
- func CloseDB() error
- func CreateDB() error
- func DeleteMessage(msgId string) error
- func Deregister(id string) error
- func GenerateIdentifier() string
- func GetDBVersion() (string, error)
- func KeyExists(name string) bool
- func OpenDB()
- func OpenMemDB() error
- func Revoke(name string) error
- type AccessKey
- type Deployment
- func (dp *Deployment) AddResponse(mailbox, response string, isErr bool) error
- func (dp *Deployment) Create() error
- func (dp *Deployment) Deploy(mb *Mailbox) (*Message, error)
- func (dp *Deployment) GetName() string
- func (dp *Deployment) GetResponses() ([]DeploymentResponse, error)
- func (dp *Deployment) Save() error
- func (dp *Deployment) Stats() (*DeploymentStats, error)
- type DeploymentResponse
- type DeploymentStats
- type Mailbox
- func (mb *Mailbox) Checkin(host, version string) error
- func (mb *Mailbox) DeployMessage(depId string) (*Message, error)
- func (mb *Mailbox) GetMessage() (*Message, error)
- func (mb *Mailbox) MessageCount() (int64, error)
- func (mb *Mailbox) Purge() (int64, error)
- func (mb *Mailbox) PutMessage(body string) (*Message, error)
- type Message
- type SystemStats
Constants ¶
This section is empty.
Variables ¶
var DB *ql.DB
Functions ¶
func AssetPending ¶
func DeleteMessage ¶
Marks a message as deleted in the mailbox.
func Deregister ¶
func GenerateIdentifier ¶
func GenerateIdentifier() string
GenerateIdentifier is used for generating various IDs. It is used to create messageIds, deploymentIds, access tokens, etc.
func GetDBVersion ¶
Types ¶
type AccessKey ¶
func FindKeyByName ¶
type Deployment ¶
type Deployment struct { Id string Name string DeployedAt time.Time DeployedBy string TotalMessages int64 MessageBody string Open bool Asset string }
func FindDeployment ¶
func FindDeployment(id string) (*Deployment, error)
func ListDeployments ¶
func ListDeployments(name string, count int, token string) ([]Deployment, error)
func (*Deployment) AddResponse ¶
func (dp *Deployment) AddResponse(mailbox, response string, isErr bool) error
func (*Deployment) Create ¶
func (dp *Deployment) Create() error
func (*Deployment) GetName ¶
func (dp *Deployment) GetName() string
func (*Deployment) GetResponses ¶
func (dp *Deployment) GetResponses() ([]DeploymentResponse, error)
func (*Deployment) Save ¶
func (dp *Deployment) Save() error
func (*Deployment) Stats ¶
func (dp *Deployment) Stats() (*DeploymentStats, error)
type DeploymentResponse ¶
type DeploymentStats ¶
type Mailbox ¶
Mailboxes represent a bucket or queue of messages. Messages can be added to the mailbox through a deployment. Messages can be requested from the mailbox and one will be returned (with no garenteed ordering). Once the message has been processed it can be deleted from the mailbox.
Mailboxes must have a unique Id, but this value can be anything unique. The system is designed with the idea of manually created and namespaced identifiers such as:
newton.maxwell.bohr
This allows pattern searches to be intuitive such as:
newton.*.bohr
func Search ¶
Search will return a slice of mailboxes whos identifiers match a given pattern. This pattern can be any valid regex. However it will automatically convert '*' to '.*'. This allows * to be used as a simple wildcard when searching by pattern.
func (*Mailbox) DeployMessage ¶
DeployMessage accepts a deployment identifier and adds this mailbox to its deployment. A new message will be available for this deployment in the mailbox.
func (*Mailbox) GetMessage ¶
GetMessage returns a message from the mailbox. Once the message is processed it should be removed from the queue with Delete.
func (*Mailbox) MessageCount ¶
MessageCount returns a cound of all pending messages in the mailbox. This will not return messages that were marked as deleted.
type Message ¶
type Message struct { Id string Body string ReceiveCount int64 Mailbox string CreatedAt time.Time LastReceivedAt time.Time Deployment string Deleted bool }
func FindMessage ¶
FindMessage will return a Message or nil for a given message identifier
func (*Message) GetDeployment ¶
func (m *Message) GetDeployment() (*Deployment, error)
type SystemStats ¶
func Stats ¶
func Stats() (*SystemStats, error)
Stats returns a SystemStats structure with overall message count information.