Files
quyun/backend/providers/app/config.go
Rogee bc495544c8
Some checks failed
build quyun / Build (push) Failing after 12m45s
feat: update go module, add recharge wechat
2025-12-04 11:47:37 +08:00

50 lines
834 B
Go

package app
import (
"go.ipao.vip/atom/container"
"go.ipao.vip/atom/opt"
)
const DefaultPrefix = "App"
func DefaultProvider() container.ProviderContainer {
return container.ProviderContainer{
Provider: Provide,
Options: []opt.Option{
opt.Prefix(DefaultPrefix),
},
}
}
// swagger:enum AppMode
// ENUM(development, release, test)
type AppMode string
type Config struct {
Mode AppMode
Cert *Cert
BaseURI *string
StoragePath string
DistAdmin string
DistWeChat string
RechargeWechat string
}
func (c *Config) IsDevMode() bool {
return c.Mode == AppModeDevelopment
}
func (c *Config) IsReleaseMode() bool {
return c.Mode == AppModeRelease
}
func (c *Config) IsTestMode() bool {
return c.Mode == AppModeTest
}
type Cert struct {
CA string
Cert string
Key string
}