config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConfigFile = "/usr/local/etc/telegram-uploader-bot.cfg"

	ConfigKeyBotToken = "telegram.token"
)

Variables

View Source
var ConfigFile string

Functions

This section is empty.

Types

type Config

type Config struct {
	Telegram Telegram
	Uploads  []Upload
}

func NewConfig

func NewConfig(cmd *cobra.Command) (*Config, error)

type Tags

type Tags struct {
	Plain  []string
	Regexp []string
	Expr   []string
}

type Telegram

type Telegram struct {
	Token string
}

type Upload

type Upload struct {
	Directory    string
	FilePatterns []string          `mapstructure:"files"`
	MinSize      datasize.ByteSize `mapstructure:"min_size"`
	MaxSize      datasize.ByteSize `mapstructure:"max_size"`
	ChatId       int64             `mapstructure:"chat"`
	Document     bool
	Tags         Tags
}

Jump to

Keyboard shortcuts

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