config

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() error

func ReloadConfig added in v0.9.0

func ReloadConfig() error

func Set added in v0.9.0

func Set(key string, value any)

Types

type Config

type Config struct {
	Workers      int  `toml:"workers" mapstructure:"workers"`
	Retry        int  `toml:"retry" mapstructure:"retry"`
	NoCleanCache bool `toml:"no_clean_cache" mapstructure:"no_clean_cache" json:"no_clean_cache"`
	Threads      int  `toml:"threads" mapstructure:"threads" json:"threads"`
	Stream       bool `toml:"stream" mapstructure:"stream" json:"stream"`

	Users []userConfig `toml:"users" mapstructure:"users" json:"users"`

	Temp     tempConfig              `toml:"temp" mapstructure:"temp"`
	Log      logConfig               `toml:"log" mapstructure:"log"`
	DB       dbConfig                `toml:"db" mapstructure:"db"`
	Telegram telegramConfig          `toml:"telegram" mapstructure:"telegram"`
	Storages []storage.StorageConfig `toml:"-" mapstructure:"-" json:"storages"`
}
var Cfg *Config

func (Config) GetStorageByName added in v0.11.0

func (c Config) GetStorageByName(name string) storage.StorageConfig

func (*Config) GetStorageNamesByUserID added in v0.11.0

func (c *Config) GetStorageNamesByUserID(userID int64) []string

func (*Config) GetUsersID added in v0.11.0

func (c *Config) GetUsersID() []int64

func (*Config) HasStorage added in v0.11.0

func (c *Config) HasStorage(userID int64, storageName string) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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