configs

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigFile = "./data/animego.yaml"
View Source
var (
	ConfigVersion = "1.3.0" // 当前配置文件版本

)

Functions

func BackupConfig added in v0.6.2

func BackupConfig(file string, version string) error

func Config2Bytes added in v0.6.2

func Config2Bytes(config *Config) []byte

func DefaultDoc added in v0.4.3

func DefaultDoc() []byte

func DefaultFile added in v0.4.0

func DefaultFile(filename string) error

func UpdateConfig added in v0.5.0

func UpdateConfig(oldFile string, backup bool) (restart bool)

Types

type Advanced

type Advanced struct {
	UpdateDelaySecond int `yaml:"update_delay_second" json:"update_delay_second" attr:"更新状态等待时间"`

	Request struct {
		TimeoutSecond   int `yaml:"timeout_second" json:"timeout_second" attr:"请求超时时间"`
		RetryNum        int `yaml:"retry_num" json:"retry_num" attr:"额外重试次数"`
		RetryWaitSecond int `yaml:"retry_wait_second" json:"retry_wait_second" attr:"重试间隔等待时间"`
	} `yaml:"request" json:"request" attr:"网络请求设置"`

	Download struct {
		AllowDuplicateDownload bool   `yaml:"allow_duplicate_download" json:"allow_duplicate_download" attr:"允许重复下载"`
		SeedingTimeMinute      int    `yaml:"seeding_time_minute" json:"seeding_time_minute" attr:"做种时间"`
		IgnoreSizeMaxKb        int    `yaml:"ignore_size_max_kb" json:"ignore_size_max_kb" attr:"忽略小文件大小"`
		Rename                 string `yaml:"rename" json:"rename" attr:"重命名方式" comment_key:"rename"`
	} `yaml:"download" json:"download" attr:"下载设置"`

	Feed struct {
		UpdateDelayMinute int `yaml:"update_delay_minute" json:"update_delay_minute" attr:"订阅刷新时间"`
		DelaySecond       int `yaml:"delay_second" json:"delay_second" attr:"订阅解析间隔时间"`
		MultiGoroutine    struct {
			Enable       bool `yaml:"enable" json:"enable" attr:"启用"`
			GoroutineMax int  `yaml:"goroutine_max" json:"goroutine_max" attr:"最大协程数量"`
		} `yaml:"multi_goroutine" json:"multi_goroutine" attr:"订阅多协程解析"`
	} `yaml:"feed" json:"feed" attr:"订阅设置"`

	Default struct {
		TMDBFailSkip           bool `` /* 133-byte string literal not displayed */
		TMDBFailUseTitleSeason bool `` /* 181-byte string literal not displayed */
		TMDBFailUseFirstSeason bool `` /* 163-byte string literal not displayed */
	} `` /* 172-byte string literal not displayed */

	Client struct {
		ConnectTimeoutSecond int `yaml:"connect_timeout_second" json:"connect_timeout_second" attr:"连接超时时间"`
		RetryConnectNum      int `yaml:"retry_connect_num" json:"retry_connect_num" attr:"连接失败重试次数"`
		CheckTimeSecond      int `yaml:"check_time_second" json:"check_time_second" attr:"检查连接状态间隔时间"`
	} `yaml:"client" json:"client" attr:"下载客户端设置"`

	Cache struct {
		MikanCacheHour      int `` /* 153-byte string literal not displayed */
		BangumiCacheHour    int `` /* 157-byte string literal not displayed */
		ThemoviedbCacheHour int `` /* 165-byte string literal not displayed */
	} `yaml:"cache" json:"cache" attr:"缓存设置"`
}

type Config

type Config struct {
	Version  string `yaml:"version" json:"version" attr:"配置文件版本"`
	Setting  `yaml:"setting" json:"setting" attr:"常规设置"`
	Plugin   `yaml:"plugin" json:"plugin" attr:"插件设置" comment_key:"plugin_help"`
	Advanced `yaml:"advanced" json:"advanced" attr:"高级设置"`
}

func DefaultConfig added in v0.4.0

func DefaultConfig() *Config

func Init

func Init(file string) *Config

func (*Config) InitDir

func (c *Config) InitDir()

func (*Config) Proxy

func (c *Config) Proxy() string

type ConfigOnlyVersion added in v0.6.5

type ConfigOnlyVersion struct {
	Version string `yaml:"version" json:"version"`
}

type Plugin added in v0.7.2

type Plugin struct {
	Filter   []models.Plugin `yaml:"filter" json:"filter" attr:"过滤器插件" comment:"用来筛选符合条件的项目进行解析下载"`
	Schedule []models.Plugin `yaml:"schedule" json:"schedule" attr:"定时任务" comment:"定时执行脚本"`
}

type Setting

type Setting struct {
	Feed struct {
		Mikan struct {
			Name string `yaml:"name" json:"name" attr:"别名"`
			Url  string `yaml:"url" json:"url" attr:"订阅链接" comment:"可空,为空则不使用自动订阅"`
		} `yaml:"mikan" json:"mikan" attr:"Mikan订阅"`
	} `yaml:"feed" json:"feed" attr:"自动订阅设置"`
	Client struct {
		QBittorrent struct {
			Url      string `yaml:"url" json:"url" attr:"地址"`
			Username string `yaml:"username" json:"username" attr:"用户名"`
			Password string `yaml:"password" json:"password" attr:"密码"`
		} `yaml:"qbittorrent" json:"qbittorrent" attr:"qBittorrent客户端"`
	} `yaml:"client" json:"client" attr:"下载客户端设置"`
	DownloadPath string `yaml:"download_path" json:"download_path" attr:"下载文件夹" comment:"下载器的下载文件夹"`
	SavePath     string `yaml:"save_path" json:"save_path" attr:"保存文件夹" comment:"下载完成后,重命名并移动到的文件夹"`
	DataPath     string `yaml:"data_path" json:"data_path" attr:"数据文件夹" comment:"用于保存数据库、插件等数据"`
	Category     string `yaml:"category" json:"category" attr:"分类名" comment:"仅qBittorrent有效"`
	Tag          string `yaml:"tag" json:"tag" attr:"标签表达式" comment_key:"tag_help"`
	WebApi       struct {
		AccessKey string `yaml:"access_key" json:"access_key" attr:"请求秘钥" comment:"为空则不需要验证"`
		Host      string `yaml:"host" json:"host" attr:"域名"`
		Port      int    `yaml:"port" json:"port" attr:"端口"`
	} `yaml:"webapi" json:"webapi" attr:"WebApi设置"`
	Proxy struct {
		Enable bool   `yaml:"enable" json:"enable" attr:"启用"`
		Url    string `yaml:"url" json:"url" attr:"代理链接"`
	} `yaml:"proxy" json:"proxy" attr:"代理设置" comment:"开启后AnimeGo所有的网络请求都会使用代理"`
	Key struct {
		Themoviedb string `yaml:"themoviedb" json:"themoviedb" attr:"TheMovieDB的APIkey" comment_key:"themoviedb_key"`
	} `yaml:"key" json:"key" attr:"秘钥设置"`
}

type Version added in v0.6.5

type Version struct {
	Name       string
	Desc       string
	UpdateFunc func(string) // 从上个版本升级到当前版本的升级函数
}

Directories

Path Synopsis
version

Jump to

Keyboard shortcuts

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