pushbullet

package
v0.0.0-...-7f90a9e Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateChannelPayload

func CreateChannelPayload(config *Config, target string, partialPayload JSON) ([]byte, error)

CreateChannelPayload from a base message

func CreateDevicePayload

func CreateDevicePayload(config *Config, target string, partialPayload JSON) ([]byte, error)

CreateDevicePayload from a base message

func CreateEmailPayload

func CreateEmailPayload(config *Config, target string, partialPayload JSON) ([]byte, error)

CreateEmailPayload from a base message

func CreateJSONPayload

func CreateJSONPayload(target string, targetType TargetType, config *Config, message string, params *types.Params) ([]byte, error)

CreateJSONPayload compatible with the slack webhook api

Types

type Config

type Config struct {
	standard.QuerylessConfig
	standard.EnumlessConfig
	Targets []string
	Token   string
}

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 ErrorMessage

type ErrorMessage string

ErrorMessage for error events within the pushbullet service

const (

	//Scheme is the scheme part of the service configuration URL
	Scheme = "pushbullet"
	//TokenIncorrectSize for the serviceURL
	TokenIncorrectSize ErrorMessage = "Token has incorrect size"
)

type JSON

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

JSON used within the Slack service

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 *log.Logger) 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 ...

type TargetType

type TargetType int

TargetType ...

const (
	// EmailTarget ...
	EmailTarget TargetType = 1
	// ChannelTarget ...
	ChannelTarget TargetType = 2
	// DeviceTarget ...
	DeviceTarget TargetType = 3
)

Jump to

Keyboard shortcuts

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