README
¶
Azugo Core
Azugo framework core.
Features
- Structured logger go.uber.org/zap
- Extendable configuration viper and command line cobra support
- Caching using memory or Redis
Special Environment variables used by the Azugo framework
ENVIRONMENT
- An App environment setting (allowed values areDevelopment
,Staging
andProduction
).
Documentation
¶
Index ¶
- func Run(a Runnable)
- type App
- func (a *App) BackgroundContext() context.Context
- func (a *App) Cache() *cache.Cache
- func (a *App) Config() *config.Configuration
- func (a *App) Env() Environment
- func (a *App) Log() *zap.Logger
- func (a *App) SetConfig(cmd *cobra.Command, conf *config.Configuration)
- func (a *App) SetVersion(version, builtWith string)
- func (a *App) Start() error
- func (a *App) Stop()
- func (a *App) String() string
- func (a *App) Validate() *validation.Validate
- type Environment
- type Runnable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct { // App settings AppVer string AppBuiltWith string AppName string // contains filtered or unexported fields }
func (*App) BackgroundContext ¶
BackgroundContext returns global background context
func (*App) Config ¶
func (a *App) Config() *config.Configuration
Config returns application configuration.
Panics if configuration is not loaded.
func (*App) SetConfig ¶
func (a *App) SetConfig(cmd *cobra.Command, conf *config.Configuration)
SetConfig binds application configuration to the application
func (*App) SetVersion ¶
SetVersion sets application version and built with tags
func (*App) Validate ¶
func (a *App) Validate() *validation.Validate
Validate returns validation service instance.
type Environment ¶
type Environment string
Environment type.
const ( EnvironmentDevelopment Environment = "Development" EnvironmentStaging Environment = "Staging" EnvironmentProduction Environment = "Production" )
func NewEnvironment ¶
func NewEnvironment(defaultMode Environment) Environment
NewEnvironment creates new Environment instance.
func (Environment) IsDevelopment ¶
func (e Environment) IsDevelopment() bool
IsDevelopment checks if current environment is development.
func (Environment) IsProduction ¶
func (e Environment) IsProduction() bool
IsProduction checks if current environment is production.
func (Environment) IsStaging ¶
func (e Environment) IsStaging() bool
IsStaging checks if current environment is staging.
Click to show internal directories.
Click to hide internal directories.