telegram

package module
v0.0.0-...-ae36d4e Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts Options) send.Sender

New constructs a telegram sender. The implementation posts each message independently. Use the buffered send.Sender implementation to batch these messages.

Types

type Options

type Options struct {
	Name   string `bson:"name" json:"name" yaml:"name"`
	Token  string `bson:"token" json:"token" yaml:"token"`
	Target string `bson:"target" json:"target" yaml:"target"`

	// Optional: BaseURL defaults to https://api.telegram.org, and
	// a new [unconfigured] HTTP client is constructed if one is
	// not provided.
	BaseURL string `bson:"base_url" json:"base_url" yaml:"base_url"`
	Client  *http.Client
}

Options are used to configure a telegram sender.

func (Options) IsZero

func (opts Options) IsZero() bool

func (*Options) Validate

func (opts *Options) Validate() error

Jump to

Keyboard shortcuts

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