gotify

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Scheme is the identifying part of this service's configuration URL
	Scheme = "gotify"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	standard.EnumlessConfig
	Token      string `url:"path2" desc:"Application token" required:""`
	Host       string `url:"host,port" desc:"Server hostname (and optionally port)" required:""`
	Path       string `optional:"" url:"path1" desc:"Server subpath"`
	Priority   int    `key:"priority" default:"0"`
	Title      string `key:"title" default:"Shoutrrr notification"`
	DisableTLS bool   `key:"disabletls" default:"No"`
}

Config for use within the gotify plugin

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 JSON

type JSON struct {
	Message  string `json:"message"`
	Title    string `json:"title"`
	Priority int    `json:"priority"`
}

JSON is the actual payload being sent to the Gotify API

type Service

type Service struct {
	standard.Standard

	Client *http.Client
	// contains filtered or unexported fields
}

Service providing Gotify 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 notification message to Gotify

Jump to

Keyboard shortcuts

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