pushbullet

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//Scheme is the scheme part of the service configuration URL
	Scheme = "pushbullet"
)

Variables

View Source
var ErrorTokenIncorrectSize = errors.New("token has incorrect size")

ErrorTokenIncorrectSize is the error returned when the token size is incorrect

Functions

This section is empty.

Types

type Config

type Config struct {
	standard.EnumlessConfig
	Targets []string `url:"path"`
	Token   string   `url:"host"`
	Title   string   `key:"title" default:"Shoutrrr notification"`
}

Config ...

func (*Config) GetURL

func (config *Config) GetURL() *url.URL

GetURL returns a URL representation of it's current field values

func (*Config) SetURL

func (config *Config) SetURL(url *url.URL) error

SetURL updates a ServiceConfig from a URL representation of it's field values

type ErrorResponse added in v0.5.0

type ErrorResponse struct {
	ErrorData struct {
		Cat     string `json:"cat"`
		Message string `json:"message"`
		Type    string `json:"type"`
	} `json:"error"`
}

func (*ErrorResponse) Error added in v0.5.0

func (err *ErrorResponse) Error() string

type PushRequest added in v0.5.0

type PushRequest struct {
	Type  string `json:"type"`
	Title string `json:"title"`
	Body  string `json:"body"`

	Email      string `json:"email"`
	ChannelTag string `json:"channel_tag"`
	DeviceIden string `json:"device_iden"`
}

PushRequest ...

func NewNotePush added in v0.5.0

func NewNotePush(message, title string) *PushRequest

NewNotePush creates a new push request

func (*PushRequest) SetTarget added in v0.5.0

func (p *PushRequest) SetTarget(target string)

type PushResponse added in v0.5.0

type PushResponse struct {
	Active                  bool    `json:"active"`
	Body                    string  `json:"body"`
	Created                 float64 `json:"created"`
	Direction               string  `json:"direction"`
	Dismissed               bool    `json:"dismissed"`
	Iden                    string  `json:"iden"`
	Modified                float64 `json:"modified"`
	ReceiverEmail           string  `json:"receiver_email"`
	ReceiverEmailNormalized string  `json:"receiver_email_normalized"`
	ReceiverIden            string  `json:"receiver_iden"`
	SenderEmail             string  `json:"sender_email"`
	SenderEmailNormalized   string  `json:"sender_email_normalized"`
	SenderIden              string  `json:"sender_iden"`
	SenderName              string  `json:"sender_name"`
	Title                   string  `json:"title"`
	Type                    string  `json:"type"`
}

type Service

type Service struct {
	standard.Standard
	// contains filtered or unexported fields
}

Service providing Pushbullet as a notification service

func (*Service) Initialize

func (service *Service) Initialize(configURL *url.URL, logger types.StdLogger) error

Initialize loads ServiceConfig from configURL and sets logger for this Service

func (*Service) Send

func (service *Service) Send(message string, params *types.Params) error

Send a push notification via Pushbullet

Jump to

Keyboard shortcuts

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