Documentation ¶
Index ¶
- func SetEnvPrefix(val string)
- type Application
- func (app *Application) Add(name string, configuration map[string]any)
- func (app *Application) Env(envName string, defaultValue ...any) any
- func (app *Application) Get(path string, defaultValue ...any) any
- func (app *Application) GetAll() map[string]any
- func (app *Application) GetBool(path string, defaultValue ...any) bool
- func (app *Application) GetDuration(path string, defaultValue ...any) time.Duration
- func (app *Application) GetFloat64(path string, defaultValue ...any) float64
- func (app *Application) GetInt(path string, defaultValue ...any) int
- func (app *Application) GetInt64(path string, defaultValue ...any) int64
- func (app *Application) GetString(path string, defaultValue ...any) string
- func (app *Application) GetUint(path string, defaultValue ...any) uint
- func (app *Application) Viper() *viper.Viper
- type ServiceProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetEnvPrefix ¶
func SetEnvPrefix(val string)
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func NewApplication ¶
func NewApplication(envPath ...string) *Application
func (*Application) Add ¶
func (app *Application) Add(name string, configuration map[string]any)
Add config to application.
func (*Application) Env ¶
func (app *Application) Env(envName string, defaultValue ...any) any
Env Get config from env.
func (*Application) Get ¶
func (app *Application) Get(path string, defaultValue ...any) any
Get config from application.
@param path eg: "app.name"
func (*Application) GetAll ¶
func (app *Application) GetAll() map[string]any
GetAll Get all config from application.
func (*Application) GetBool ¶
func (app *Application) GetBool(path string, defaultValue ...any) bool
GetBool Get bool type config from application.
func (*Application) GetDuration ¶
func (app *Application) GetDuration(path string, defaultValue ...any) time.Duration
GetDuration Get time.Duration type config from application.
func (*Application) GetFloat64 ¶
func (app *Application) GetFloat64(path string, defaultValue ...any) float64
GetFloat64 Get float64 type config from application.
func (*Application) GetInt ¶
func (app *Application) GetInt(path string, defaultValue ...any) int
GetInt Get int type config from application.
func (*Application) GetInt64 ¶
func (app *Application) GetInt64(path string, defaultValue ...any) int64
GetInt64 Get int64 type config from application.
func (*Application) GetString ¶
func (app *Application) GetString(path string, defaultValue ...any) string
GetString Get string type config from application.
func (*Application) GetUint ¶
func (app *Application) GetUint(path string, defaultValue ...any) uint
GetUint Get uint type config from application.
func (*Application) Viper ¶
func (app *Application) Viper() *viper.Viper
type ServiceProvider ¶
type ServiceProvider struct { }
func (*ServiceProvider) Boot ¶
func (config *ServiceProvider) Boot()
func (*ServiceProvider) Register ¶
func (config *ServiceProvider) Register()
Click to show internal directories.
Click to hide internal directories.