config

package
v0.0.0-...-c2e572c Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Listen        string   `yaml:"listen"`
	LogLevel      string   `yaml:"log_level"`
	LogFormat     string   `yaml:"log_format"`
	Secret        string   `yaml:"secret"`
	Database      Database `yaml:"database"`
	Telegram      Telegram `yaml:"telegram"`
	MetricsListen string   `yaml:"metrics_listen"`
	Upload        Upload   `yaml:"upload"`
	FileBackend   afero.Fs
}

func LoadConfig

func LoadConfig(path string) Config

LoadConfig loads config from file.

type Database

type Database struct {
	Type string `yaml:"type"`
	DSN  string `yaml:"dsn"`
}

type Telegram

type Telegram struct {
	Token string `yaml:"token"`
	User  tgbotapi.User
}

func (*Telegram) Enabled

func (t *Telegram) Enabled() bool

Enabled returns true if the required token is not empty.

type Upload

type Upload struct {
	Path string `yaml:"path"`
	URL  string `yaml:"url"`
}

Jump to

Keyboard shortcuts

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