tgnotifier

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfigPath = ".tgnotifier.yml"

DefaultConfigPath is a path to a config file by default.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, opt *Options) error

Run executes the message sending.

Types

type DependencyContainer

type DependencyContainer struct {
	EnvGetter func(string) string
	Config    *config.Config
	Client    *tgkit.Client
	Sender    *sender.Sender
	Processor *msgproc.MessageProcessor
}

type Options

type Options struct {
	ConfigPath string

	BotName  types.BotName
	ChatName types.ChatName

	Message sender.MessageOptions

	IsDebug bool
}

Options is a tgnotifier CLI options.

func NewOptions

func NewOptions() *Options

NewOptions creates new Options with default values.

func (*Options) Normalize

func (opt *Options) Normalize()

Normalize normalizes the values and sets the default values if missing.

func (*Options) Validate

func (opt *Options) Validate() error

Validate validates if given values are valid.

Jump to

Keyboard shortcuts

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