Documentation ¶
Index ¶
- Constants
- type Client
- func (client *Client) GetAllProviders() (providers []*Provider, err error)
- func (client *Client) GetNotificationsSince(since *time.Time) (n []*Notification, err error)
- func (client *Client) GetSingleNotification(id int) (n *Notification, err error)
- func (client *Client) GetSingleProvider(providerName string) (p *Provider, err error)
- func (client *Client) GetUnheardNotifications() (n []*Notification, err error)
- func (client *Client) PushNotification(n Notification) (err error)
- func (client *Client) RegisterProvider(p Provider) (err error)
- type Notification
- type Provider
Constants ¶
View Source
const ( // Priorities PRIO_LOW = 10 PRIO_MED = 20 PRIO_HIGH = 30 // Actions ACT_POLL = 10 ACT_PUSH = 20 // Heard status HRD_UNHEARD = 10 HRD_HEARD = 20 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
each model implements methods to consume Shruti API using this client
func (*Client) GetAllProviders ¶
func (*Client) GetNotificationsSince ¶
func (client *Client) GetNotificationsSince(since *time.Time) (n []*Notification, err error)
func (*Client) GetSingleNotification ¶
func (client *Client) GetSingleNotification(id int) (n *Notification, err error)
func (*Client) GetSingleProvider ¶
func (*Client) GetUnheardNotifications ¶
func (client *Client) GetUnheardNotifications() (n []*Notification, err error)
func (*Client) PushNotification ¶
func (client *Client) PushNotification(n Notification) (err error)
func (*Client) RegisterProvider ¶
type Notification ¶
type Notification struct { Id int `json:"id"` Title string `json:"title"` Url string `json:"url, omitempty"` Key string `json:"key"` Heard int `json:"heard"` Provider int `json:"provider"` CreatedOn time.Time `json:"created_on, omitempty"` Priority int `json:"priority"` Action int `json:"action"` ProviderName string `json:"provider_name, omitempty"` }
type Provider ¶
type Provider struct { Id int `json:"id, omitempty"` Name string `json:"name"` DisplayName string `json:"display_name"` Description string `json:"description, omitempty"` WebURL string `json:"web_url, omitempty"` IconURL string `json:"icon_url, omitempty"` Active bool `json:"active, omitempty"` Voice string `json:"voice"` }
Click to show internal directories.
Click to hide internal directories.