Documentation
¶
Index ¶
- Variables
- type ConfigOption
- type ConfigService
- func (c *ConfigService) Get(key string) interface{}
- func (c *ConfigService) GetBool(key string) bool
- func (c *ConfigService) GetDuration(key string) time.Duration
- func (c *ConfigService) GetFloat64(key string) float64
- func (c *ConfigService) GetInt(key string) int
- func (c *ConfigService) GetInt32(key string) int32
- func (c *ConfigService) GetInt64(key string) int64
- func (c *ConfigService) GetString(key string) string
- func (c *ConfigService) GetStringMap(key string) map[string]interface{}
- func (c *ConfigService) GetStringSlice(key string) []string
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigModule = gimbap.DefineModule(gimbap.ModuleOption{ Name: "ConfigModule", Providers: []*gimbap.Provider{ ConfigServiceProvider, }, })
View Source
var ConfigServiceProvider = gimbap.DefineProvider(gimbap.ProviderOption{ Name: "ConfigServiceProvider", Instantiator: NewConfigService, })
Functions ¶
This section is empty.
Types ¶
type ConfigOption ¶
type ConfigOption struct {
// File path list of the configuration files to use
ConfigFilePathList []string
// Raw configuration data
ConfigData map[string]interface{}
// Toggle the automatic watching of the configuration file changes
WatchConfigChange bool
// Prevent the auto loading of the configuration file. Default is false
PreventAutoLoad bool
}
type ConfigService ¶
type ConfigService struct {
// contains filtered or unexported fields
}
func NewConfigService ¶
func NewConfigService(option ConfigOption) *ConfigService
func (*ConfigService) Get ¶
func (c *ConfigService) Get(key string) interface{}
func (*ConfigService) GetBool ¶
func (c *ConfigService) GetBool(key string) bool
func (*ConfigService) GetDuration ¶
func (c *ConfigService) GetDuration(key string) time.Duration
func (*ConfigService) GetFloat64 ¶
func (c *ConfigService) GetFloat64(key string) float64
func (*ConfigService) GetInt ¶
func (c *ConfigService) GetInt(key string) int
func (*ConfigService) GetInt32 ¶
func (c *ConfigService) GetInt32(key string) int32
func (*ConfigService) GetInt64 ¶
func (c *ConfigService) GetInt64(key string) int64
func (*ConfigService) GetString ¶
func (c *ConfigService) GetString(key string) string
func (*ConfigService) GetStringMap ¶
func (c *ConfigService) GetStringMap(key string) map[string]interface{}
func (*ConfigService) GetStringSlice ¶
func (c *ConfigService) GetStringSlice(key string) []string
Click to show internal directories.
Click to hide internal directories.