ifttt

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 identifying part of this service's configuration URL
	Scheme = "ifttt"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	standard.EnumlessConfig
	WebHookID         string   `url:"host" required:"true"`
	Events            []string `key:"events" required:"true"`
	Value1            string   `key:"value1" optional:""`
	Value2            string   `key:"value2" optional:""`
	Value3            string   `key:"value3" optional:""`
	UseMessageAsValue uint8    `key:"messagevalue" desc:"Sets the corresponding value field to the notification message" default:"2"`
	UseTitleAsValue   uint8    `key:"titlevalue" desc:"Sets the corresponding value field to the notification title" default:"0"`
	Title             string   `key:"title" default:"" desc:"Notification title, optionally set by the sender"`
}

Config is the configuration needed to send IFTTT notifications

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 Service

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

Service sends notifications to a IFTTT webhook

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 notification message to a IFTTT webhook

Jump to

Keyboard shortcuts

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