Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidConfig = errors.New("webhook: invalid configuration")
View Source
var Quit, _ = context.WithCancel(context.Background())
Functions ¶
Types ¶
type Config ¶
type Config struct {
Filename string `toml:"-" yaml:"-" json:"-"` // 配置文件保存路径
Path Path `toml:"path" yaml:"path" json:"path"` // 各文件路径
Server Server `toml:"server" yaml:"server" json:"server"` // 服务器参数
Role Role `toml:"role" yaml:"role" json:"role "` // 权限组
Extra map[string]any `toml:"extra" yaml:"extra" json:"extra"` // 额外项
}
webhook 配置
type Path ¶ added in v0.4.1
type Path struct {
Root string `toml:"root" yaml:"root" json:"root" default:"resource"` // 程序根目录
Logs string `toml:"logs" yaml:"logs" json:"logs" default:"logs" join:"Root"` // 记录文件夹
UserDB string `toml:"userDB" yaml:"userDB" json:"userDB" default:"users.db" join:"Root"` // 用户数据库文件
BlogDB string `toml:"blogDB" yaml:"blogDB" json:"blogDB" default:"blogs.db" join:"Root"` // 博文数据库文件
Public string `toml:"public" yaml:"public" json:"public" default:"public" join:"Root"` // 公开文件夹
Backup string `toml:"backup" yaml:"backup" json:"backup" default:"backup" join:"Public"` // 博文数据库备份文件夹
Full *Path `toml:"-" yaml:"-" json:"-"` // 以上字段的全路径 通过 utils.NewJoin 函数拼接
}
func (*Path) AfterInitial ¶ added in v0.15.0
func (*Path) CopyBlogDB ¶ added in v0.15.0
func (p *Path) CopyBlogDB()
Click to show internal directories.
Click to hide internal directories.