shrutigo

package module
v0.0.0-...-d86a8be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2015 License: MIT Imports: 6 Imported by: 4

README

shruti-go

wrapper around shruti API

Documentation

Index

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

type Client struct {
	Protocol string
	Host     string
}

each model implements methods to consume Shruti API using this client

func (*Client) DeleteProvider

func (client *Client) DeleteProvider(pname string) (err error)

func (*Client) GetAllProviders

func (client *Client) GetAllProviders() (providers []*Provider, err error)

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 *Client) GetSingleProvider(providerName string) (p *Provider, err error)

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

func (client *Client) RegisterProvider(p Provider) (err error)

func (*Client) UpdateProvider

func (client *Client) UpdateProvider(p Provider) (err error)

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"`
}

Directories

Path Synopsis
Godeps
_workspace/src/github.com/parnurzeal/gorequest
Package gorequest inspired by Nodejs SuperAgent provides easy-way to write http client
Package gorequest inspired by Nodejs SuperAgent provides easy-way to write http client
_workspace/src/golang.org/x/net/publicsuffix
Package publicsuffix provides a public suffix list based on data from http://publicsuffix.org/.
Package publicsuffix provides a public suffix list based on data from http://publicsuffix.org/.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL