config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load() error

func SaveSettings

func SaveSettings()

Types

type AppConfiguration

type AppConfiguration struct {
	LockdownDir        string `koanf:"lockdown_dir" default:"/var/lib/lockdown"`
	DeveloperDiskImage struct {
		ImageSource string `` /* 181-byte string literal not displayed */
		CNProxy     string `koanf:"cn_proxy" json:"cn_proxy" default:"https://mirror.ghproxy.com"`
	} `koanf:"developer_disk_image" json:"developer_disk_image"`
}

type SettingsConfiguration

type SettingsConfiguration struct {
	Task struct {
		Enabled  bool     `koanf:"enabled" json:"enabled" default:"true"`
		Mode     TaskMode `koanf:"mode" json:"mode" default:"1"`
		CrodTime string   `koanf:"crod_time" json:"crod_time" default:"0,30 3-6 * * *"`
	} `koanf:"task" json:"task"`
	Notification struct {
		Enabled  bool   `koanf:"enabled" json:"enabled"`
		Type     string `koanf:"type" json:"type" default:"weixin"`
		Telegram struct {
			BotToken string `koanf:"bot_token" json:"bot_token"`
			ChatID   string `koanf:"chat_id" json:"chat_id"`
		} `koanf:"telegram" json:"telegram"`
		Weixin struct {
			CorpID     string `koanf:"corp_id" json:"corp_id"`
			CorpSecret string `koanf:"corp_secret" json:"corp_secret"`
			AgentID    string `koanf:"agent_id" json:"agent_id"`
			ToUser     string `koanf:"to_user" json:"to_user"`
		} `koanf:"weixin" json:"weixin"`
		Bark struct {
			BarkServer string `koanf:"bark_server" json:"bark_server" default:"https://api.day.app"`
			DeviceKey  string `koanf:"device_key" json:"device_key"`
		} `koanf:"bark" json:"bark"`
	} `koanf:"notification" json:"notification"`
}
var Settings SettingsConfiguration

type TaskMode

type TaskMode string
const (
	OneDayAgoMode TaskMode = "1"
	DailyMode     TaskMode = "2"
)

Jump to

Keyboard shortcuts

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