config

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2025 License: AGPL-3.0 Imports: 9 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 {
	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"`

	// Experimental: 将拷贝媒体文件的功能设为公开可用
	AsPublicCopyMediaBot bool `toml:"as_public_copy_media_bot" mapstructure:"as_public_copy_media_bot" json:"as_public_copy_media_bot"`

	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