shoutrrr: Index | Files

package telegram

import ""


Package Files

telegram.go telegram_config.go telegram_json.go telegram_token.go


const (
    Scheme = "telegram"

Scheme is the identifying part of this service's configuration URL

func IsTokenValid Uses

func IsTokenValid(token string) bool

IsTokenValid for use with telegram

type Config Uses

type Config struct {
    Token    string
    Channels []string

Config for use within the telegram plugin

func (*Config) Enums Uses

func (config *Config) Enums() map[string]types.EnumFormatter

Enums returns the fields that should use a corresponding EnumFormatter to Print/Parse their values

func (*Config) Get Uses

func (config *Config) Get(key string) (string, error)

Get returns the value of a Query field

func (*Config) GetURL Uses

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

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

func (*Config) QueryFields Uses

func (config *Config) QueryFields() []string

QueryFields returns the fields that are part of the Query of the service URL

func (*Config) Set Uses

func (config *Config) Set(key string, value string) error

Set updates the value of a Query field

func (*Config) SetURL Uses

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

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

type JSON Uses

type JSON struct {
    Text string `json:"text"`
    ID   string `json:"chat_id"`

JSON to be used as a notification payload for the telegram notification service

type Service Uses

type Service struct {
    // contains filtered or unexported fields

Service sends notifications to a given telegram chat

func (*Service) GetConfig Uses

func (service *Service) GetConfig() *Config

GetConfig returns the Config for the service

func (*Service) Initialize Uses

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 Uses

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

Send notification to Telegram

Package telegram imports 12 packages (graph) and is imported by 1 packages. Updated 2020-06-22. Refresh now. Tools for package owners.