Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RESTAddress = url.URL{
Scheme: "https",
Host: "api.pushbullet.com",
Path: "v2",
}
View Source
var StreamAddress = url.URL{
Scheme: "wss",
Host: "stream.pushbullet.com",
Path: "/websocket",
}
Functions ¶
This section is empty.
Types ¶
type MessageHandler ¶
type MessageHandler func(Pushbullet, string, Push)
type Push ¶
type Push struct {
Iden string `json:"iden"`
Active bool `json:"active"`
Created float32 `json:"created"`
Modified float32 `json:"modified"`
Type PushType `json:"type"`
Dismissed bool `json:"dismissed"`
GUID string `json:"guid"`
Direction string `json:"direction"`
SenderIden string `json:"sender_iden"`
SenderEmail string `json:"sender_email"`
SenderEmailNormalized string `json:"sender_email_normalized"`
SenderName string `json:"sender_name"`
ReceiverIden string `json:"receiver_iden"`
ReceiverEmail string `json:"receiver_email"`
ReceiverEmailNormalized string `json:"receiver_email_normalized"`
TargetDeviceIden string `json:"target_device_iden"`
SourceDeviceIden string `json:"source_device_iden"`
Body string `json:"body,omitempty"`
Title string `json:"title,omitempty"`
URL string `json:"url,omitempty"`
ChannelID string `json:"channel_iden,omitempty"`
// contains filtered or unexported fields
}
func (*Push) GeneratePayload ¶
type PushAndTag ¶
type Pushbullet ¶
type Pushbullet struct {
MessageHandler MessageHandler
// contains filtered or unexported fields
}
func New ¶
func New(apiToken string) (*Pushbullet, error)
func (*Pushbullet) Close ¶
func (pb *Pushbullet) Close() error
func (*Pushbullet) GetChannelById ¶
func (pb *Pushbullet) GetChannelById(id string) (*Channel, error)
func (*Pushbullet) Pushes ¶
func (pb *Pushbullet) Pushes() ([]PushAndTag, error)
This is unlikely to receive more than one push, but not impossible which is why we return a slice
func (*Pushbullet) SetHandler ¶
func (pb *Pushbullet) SetHandler(handler MessageHandler) *Pushbullet
type StreamEvent ¶
type StreamEvent struct {
Type StreamEventType `json:"type"`
SubType StreamEventSubtype `json:"subtype,omitempty"`
}
type StreamEventSubtype ¶
type StreamEventSubtype string
const ( StreamEventSubtypePush StreamEventSubtype = "push" // A change to the /v2/pushes resources StreamEventSubtypeDevice StreamEventSubtype = "device" // A change to the /v2/devices resources - not supported )
type StreamEventType ¶
type StreamEventType string
const ( StreamEventTypeNOP StreamEventType = "nop" StreamEventTypeTickle StreamEventType = "tickle" StreamEventTypePush StreamEventType = "push" )
type Subscription ¶
type Subscriptions ¶
type Subscriptions struct {
Subscriptions []Subscription `json:"subscriptions"`
}
Click to show internal directories.
Click to hide internal directories.