ssl.go 343 B

123456789101112131415161718192021
  1. package config
  2. import "github.com/spf13/viper"
  3. type Ssl struct {
  4. KeyStr string
  5. Pem string
  6. Enable bool
  7. Domain string
  8. }
  9. func InitSsl(cfg *viper.Viper) *Ssl {
  10. return &Ssl{
  11. KeyStr: cfg.GetString("key"),
  12. Pem: cfg.GetString("pem"),
  13. Enable: cfg.GetBool("enable"),
  14. Domain: cfg.GetString("domain"),
  15. }
  16. }
  17. var SslConfig = new(Ssl)