Documentation ¶
Overview ¶
Package config 用于配置项的各类定义
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Algorithm ¶ added in v0.6.0
type Algorithm struct { // 算法的类型 // // 有以下可用值: // - hmac // - rsa // - rspss // - ecdsa // - ed25519 Type string `json:"type" yaml:"type" xml:"type,attr"` // 算法的名称 Name string `json:"name" yaml:"name" xml:"name"` // 公钥 // // 如果是 hmac 类型,那么该值必须与 Private 相同 Public string `json:"public" yaml:"public" xml:"public"` // 私钥 // // 如果是 hmac 类型,那么该值必须与 Public 相同 Private string `json:"private" yaml:"private" xml:"private"` // contains filtered or unexported fields }
type DB ¶
type DB struct { // 表示数据库的类型 // // 目前支持以下几种类型: // - sqlite3 // - sqlite 纯 Go // - mysql // - mariadb // - postgres Type string `yaml:"type" json:"type" xml:"type,attr"` // 连接数据库的参数 DSN string `yaml:"dsn" json:"dsn" xml:"dsn"` // contains filtered or unexported fields }
DB 数据库的配置文件格式
func (*DB) SanitizeConfig ¶
func (conf *DB) SanitizeConfig() *app.ConfigError
type User ¶ added in v0.6.0
type User struct { // URLPrefix 路由地址的前缀 URLPrefix string `json:"urlPrefix,omitempty" xml:"urlPrefix,omitempty" yaml:"urlPrefix,omitempty"` // access token 的过期时间,单位为秒。 AccessExpires int `json:"accessExpires,omitempty" xml:"accessExpires,attr,omitempty" yaml:"accessExpires,omitempty"` // refresh token 的过期时间,单位为秒。 RefreshExpires int `json:"refreshExpires,omitempty" xml:"refreshExpires,attr,omitempty" yaml:"refreshExpires,omitempty"` // 支持的所有算法 Algorithms []*Algorithm `json:"algorithms,omitempty" xml:"algorithm,omitempty" yaml:"algorithms,omitempty"` }
User 带有登录功能的模块配置
func (*User) SanitizeConfig ¶ added in v0.6.0
func (o *User) SanitizeConfig() *app.ConfigError
SanitizeConfig 用于检测和修正配置项的内容
Click to show internal directories.
Click to hide internal directories.