config

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LocalServerUsed bool
View Source
var RequestOpts *gotgbot.RequestOpts

Functions

func Init

func Init()

Types

type Config

type Config struct {
	General struct {
		Token        string `yaml:"token"`
		Limit        int    `yaml:"limit" default:"100"`
		LimitPerPack int    `yaml:"limit_per_pack" default:"100"`
		Adminkey     string `yaml:"adminkey"`
		TgsSupport   bool   `yaml:"tgs_support" default:"false"`
	} `yaml:"general,omitempty"`
	Cache struct {
		Enabled     bool `yaml:"enabled" default:"true"`
		ExpireHours int  `yaml:"expire_hours" default:"1"`
		SizeLimitMB int  `yaml:"size_limit_mb" default:"500"`
	} `yaml:"cache,omitempty"`
	Subscription struct {
		Enabled bool   `yaml:"enabled" default:"false"`
		Channel string `yaml:"channel,omitempty"`
	} `yaml:"subscription,omitempty"`
	Log struct {
		Level      string `yaml:"level" default:"INFO"`
		ExpireDays int    `yaml:"expire_days" default:"7"`
	} `yaml:"log,omitempty"`
	Webhook struct {
		Enabled      bool   `yaml:"enabled" default:"false"`
		NginxEnabled bool   `yaml:"nginx_enabled" default:"false"`
		URL          string `yaml:"url,omitempty"`
		Port         int    `yaml:"port" default:"8080"`
		Cert         struct {
			SelfSigned bool   `yaml:"self-signed" default:"false"`
			CertPath   string `yaml:"cert_path,omitempty"`
			KeyPath    string `yaml:"key_path,omitempty"`
		} `yaml:"cert,omitempty"`
		Secret string `yaml:"secret,omitempty"`
	} `yaml:"webhook,omitempty"`
	Proxy struct {
		Enabled  bool   `yaml:"enabled" default:"false"`
		Type     string `yaml:"type,omitempty"`
		Host     string `yaml:"host,omitempty"`
		Port     int    `yaml:"port,omitempty"`
		Username string `yaml:"username,omitempty"`
		Password string `yaml:"password,omitempty"`
	} `yaml:"proxy,omitempty"`
	Donation struct {
		Enabled        bool   `yaml:"enabled" default:"false"`
		BonusEnabled   bool   `yaml:"bonus_enabled" default:"false"`
		Title          string `yaml:"title" default:"支持开发"`
		Description    string `yaml:"description" default:"如果你喜欢这个项目,欢迎通过以下方式支持开发!"`
		AmountRestrict struct {
			Min int `yaml:"min" default:"1"`
			Max int `yaml:"max" default:"10000"`
		} `yaml:"amount_restrict,omitempty"`
	} `yaml:"donation,omitempty"`
	Misc struct {
		Timezone string `yaml:"timezone" default:"Asia/Shanghai"`
	} `yaml:"misc,omitempty"`
	Advanced struct {
		FfmpegPath   string `yaml:"ffmpeg_path,omitempty"`
		FfmpegFilter string `yaml:"ffmpeg_filter,omitempty"`
		ApiEndpoint  string `yaml:"api_endpoint,omitempty"`
	} `yaml:"advanced,omitempty"`
	Experimental struct {
		EnableActiveGC bool `yaml:"enable_active_gc" default:"false"`
	} `yaml:"experimental,omitempty"`
}
var AppConfig *Config

Jump to

Keyboard shortcuts

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