Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = `` /* 928-byte string literal not displayed */

默认配置文件

Functions

func SaveConfig added in v1.2.0

func SaveConfig(cfg *Config) error

SaveConfig 保存配置文件

Types

type CasLogin added in v1.4.1

type CasLogin struct {
	Username               string `json:"username"`
	Password               string `json:"password"`
	DingDingQrLoginEnabled string `json:"dingDingQrLoginEnabled"`
	Level                  string `json:"level"`
}

CasLogin CAS 登录配置

type Config

type Config struct {
	CasLogin                `json:"cas_login"`
	NewjwLogin              `json:"newjw_login"`
	UserAgent               string `json:"user_agent"`
	Cookies                 `json:"cookies"`
	Time                    `json:"time"`
	Course                  *orderedmap.OrderedMap `json:"course"`
	WaitCourse              `json:"wait_course"`
	SmtpEmail               `json:"smtp_email"`
	StartTime               string `json:"start_time"`
	ClientBodyConfigEnabled string `json:"ClientBodyConfigEnabled,omitempty"`
	CrossGradeEnabled       string `json:"CrossGradeEnabled,omitempty"`
}

Config 配置文件结构体

func InitCfg

func InitCfg() (*Config, error)

func LoadConfig added in v1.4.0

func LoadConfig() (*Config, error)

LoadConfig 加载配置文件 用于在线编辑配置

func (*Config) PrintConfig added in v1.4.1

func (cfg *Config) PrintConfig()

PrintConfig 打印配置文件

func (*Config) Validate

func (cfg *Config) Validate() error

Validate 验证配置文件

type Cookies added in v1.4.1

type Cookies struct {
	JSESSIONID string `json:"JSESSIONID"`
	Route      string `json:"route"`
	Enabled    string `json:"enabled"`
}

Cookies Cookie 配置

type NewjwLogin added in v1.4.1

type NewjwLogin struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Level    string `json:"level"`
}

NewjwLogin 新教务登录配置

type SmtpEmail added in v1.4.1

type SmtpEmail struct {
	Host     string `json:"host"`
	Username string `json:"username"`
	Password string `json:"password"`
	To       string `json:"to"`
	Enabled  string `json:"enabled"`
}

SmtpEmail SMTP 邮件配置

type Time added in v1.4.1

type Time struct {
	XueNian string `json:"XueNian"`
	XueQi   string `json:"XueQi"`
}

Time 学年学期配置

type WaitCourse added in v1.4.1

type WaitCourse struct {
	Interval int    `json:"interval"`
	Enabled  string `json:"enabled"`
}

WaitCourse 蹲课配置

Jump to

Keyboard shortcuts

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