Documentation
¶
Index ¶
- func GetAccessToken() string
- func GetConfigPath() string
- func Init(configFile string, fs ...func()) error
- func InitConfig(configFile string) error
- func InitConfigByCode() error
- func SaveAccess(a Access) error
- func SaveCredential(c Credential) error
- func Set(conf *Config)
- func Show(hiddenFields ...string) string
- type Access
- type App
- type Config
- type Credential
- type Credentials
- type Database
- type LogFileConfig
- type Logger
- type Sqlite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAccessToken ¶
func GetAccessToken() string
func GetConfigPath ¶
func GetConfigPath() string
func InitConfig ¶
func InitConfigByCode ¶
func InitConfigByCode() error
func SaveAccess ¶
func SaveCredential ¶
func SaveCredential(c Credential) error
Types ¶
type Access ¶
type Config ¶
type Config struct {
Access Access `yaml:"access" json:"access"`
App App `yaml:"app" json:"app"`
Credential Credential `yaml:"credential" json:"credential"`
Database Database `yaml:"database" json:"database"`
Logger Logger `yaml:"logger" json:"logger"`
}
type Credential ¶
type Credential struct {
AppID int `yaml:"appId" json:"appId"`
AppKey string `yaml:"appKey" json:"appKey"`
SecretKey string `yaml:"secretKey" json:"secretKey"`
SignKey string `yaml:"signKey" json:"signKey"`
}
func (*Credential) IsNil ¶
func (c *Credential) IsNil() bool
type Credentials ¶
type Credentials []Credential
type LogFileConfig ¶
type LogFileConfig struct {
Filename string `yaml:"filename" json:"filename"`
}
type Logger ¶
type Logger struct {
Format string `yaml:"format" json:"format"`
IsSave bool `yaml:"isSave" json:"isSave"`
Level string `yaml:"level" json:"level"`
LogFileConfig LogFileConfig `yaml:"logFileConfig" json:"logFileConfig"`
}
type Sqlite ¶
type Sqlite struct {
ConnMaxLifetime int `yaml:"connMaxLifetime" json:"connMaxLifetime"`
DBFile string `yaml:"dbFile" json:"dbFile"`
EnableLog bool `yaml:"enableLog" json:"enableLog"`
MaxIdleConns int `yaml:"maxIdleConns" json:"maxIdleConns"`
MaxOpenConns int `yaml:"maxOpenConns" json:"maxOpenConns"`
}
Click to show internal directories.
Click to hide internal directories.