Documentation
¶
Index ¶
Constants ¶
View Source
const ( CurrentVer string = "v1.0.2" CurrentDSN string = "https://72dd7f93900d4742a436a525692a13ed@sentry.io/2124482" )
software version, sentry bug tracking id
Variables ¶
This section is empty.
Functions ¶
func CheckConfig ¶
func CheckConfig(servConf ServConfig) int
CheckConfig : detect uri validity, check needed config for recaptcha, check max expire, check cryptography requirement
Types ¶
type Network ¶
type Network struct { Listen string `yaml:"listen"` Host string `yaml:"host"` MongodbURL string `yaml:"mongodb_url"` }
Network : subconfig of ServConf
type Recaptcha ¶
type Recaptcha struct { Enable bool `yaml:"enable"` SecretKey string `yaml:"secret_key,omitempty"` SiteKey string `yaml:"site_key,omitempty"` }
Recaptcha : subconfig of ServConf
type Security ¶
type Security struct { MasterKey string `yaml:"master_key"` EncryptionKey string `yaml:"encryption_key"` EncryptionNonce string `yaml:"encryption_nonce"` }
Security : subconfig about data encryption and administration must fulfill chacha20 standard
type ServConfig ¶
type ServConfig struct { Network Network `yaml:"network"` Recaptcha Recaptcha `yaml:"recaptcha"` Security Security `yaml:"security"` Content Content `yaml:"content"` }
ServConfig consists of 4 parts
var (
ServConf ServConfig
)
global var for global server config read
func LoadConfig ¶
func LoadConfig(filePath string) (ServConfig, error)
LoadConfig : config load function, read from file.
Click to show internal directories.
Click to hide internal directories.