config

package
v0.0.0-...-eeb3f54 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(configFile string) error

Types

type ArticlesConfig

type ArticlesConfig struct {
	Port int `toml:"port"` // HTTP 服务端口
}

ArticlesConfig articles 服务配置

type Config

type Config struct {
	Logger   logger.Config  `toml:"logger" json:"logger"`
	Debug    debug.Config   `toml:"debug" json:"debug"`
	Mysql    db.Mysql       `toml:"mysql" json:"mysql"`
	Socks5   Socks5Config   `toml:"socks5" json:"socks5"`
	Reader   ReaderConfig   `toml:"reader" json:"reader"`
	Official OfficialConfig `toml:"official" json:"official"`
	Articles ArticlesConfig `toml:"articles" json:"articles"`
}
var Cfg *Config

type OfficialConfig

type OfficialConfig struct {
	Port string `toml:"port"` // HTTP 服务端口
}

OfficialConfig official 服务配置

type ReaderConfig

type ReaderConfig struct {
	Port               int `toml:"port"`
	TaskTimeout        int `toml:"task_timeout"`
	MaxConcurrentTasks int `toml:"max_concurrent_tasks"`
	LogRetentionDays   int `toml:"log_retention_days"`
}

ReaderConfig reader 服务配置

func (*ReaderConfig) GetTimeout

func (c *ReaderConfig) GetTimeout() time.Duration

GetTimeout 获取超时时间

type Socks5Config

type Socks5Config struct {
	Enabled  bool   `toml:"enabled" json:"enabled"`   // 是否启用代理
	Host     string `toml:"host" json:"host"`         // 代理服务器地址
	Port     int    `toml:"port" json:"port"`         // 代理服务器端口
	Username string `toml:"username" json:"username"` // 用户名(可选)
	Password string `toml:"password" json:"password"` // 密码(可选)
}

Socks5Config SOCKS5代理配置

func (*Socks5Config) Address

func (s *Socks5Config) Address() string

Address 返回代理地址 host:port

func (*Socks5Config) Dialer

func (s *Socks5Config) Dialer() (proxy.Dialer, error)

Dialer 返回 SOCKS5 代理拨号器

Jump to

Keyboard shortcuts

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