config

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context) 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 {
	Lang         string `toml:"lang" mapstructure:"lang" json:"lang"`
	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"`

	Cache    cacheConfig             `toml:"cache" mapstructure:"cache" json:"cache"`
	Users    []userConfig            `toml:"users" mapstructure:"users" json:"users"`
	Temp     tempConfig              `toml:"temp" mapstructure:"temp"`
	DB       dbConfig                `toml:"db" mapstructure:"db"`
	Telegram telegramConfig          `toml:"telegram" mapstructure:"telegram"`
	Storages []storage.StorageConfig `toml:"-" mapstructure:"-" json:"storages"`
	Hook     hookConfig              `toml:"hook" mapstructure:"hook" json:"hook"`
}
var Cfg *Config = &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