Documentation ¶
Overview ¶
Package system provides system builder which response for properties dependency injection.
The auto configuration composes properties object
Example ¶
This example shows how to use the system build
package main import () func main() { }
Output:
Index ¶
- type App
- type Builder
- func (b *Builder) Build(profiles ...string) (interface{}, error)
- func (b *Builder) BuildWithProfile() (interface{}, error)
- func (b *Builder) Init() error
- func (b *Builder) New(name string) *viper.Viper
- func (b *Builder) Read(name string) (interface{}, error)
- func (b *Builder) Save(p interface{}) error
- type Configuration
- type Env
- type ErrInvalidController
- type ErrNotFound
- type Logging
- type Profiles
- type Server
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { Project string `json:"project" default:"hidevopsio"` Name string `json:"name" default:"hiboot-app"` Profiles Profiles `json:"profiles"` }
App is the properties of the application, it hold the base info of the application
type Builder ¶
type Builder struct { Path string Name string FileType string Profile string ConfigType interface{} }
Builder is the config file (yaml, json) builder
func (*Builder) Build ¶
Build config file
func (*Builder) BuildWithProfile ¶ added in v0.2.0
BuildWithProfile build config file
type Configuration ¶
type Configuration struct { App App `mapstructure:"app"` Server Server `mapstructure:"server"` Logging Logging `mapstructure:"logging"` }
Configuration is the system configuration
type Env ¶
Env is the name value pair of environment variable
type ErrInvalidController ¶ added in v0.7.1
type ErrInvalidController struct {
Name string
}
ErrInvalidController invalid controller
func (*ErrInvalidController) Error ¶ added in v0.7.1
func (e *ErrInvalidController) Error() string
type ErrNotFound ¶ added in v0.7.1
type ErrNotFound struct {
Name string
}
ErrNotFound resource not found error
func (*ErrNotFound) Error ¶ added in v0.7.1
func (e *ErrNotFound) Error() string
type Logging ¶
type Logging struct {
Level string `json:"level" default:"info"`
}
Logging is the properties of logging
Click to show internal directories.
Click to hide internal directories.