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 ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct { // at.ConfigurationProperties annotation at.ConfigurationProperties `value:"app" json:"-"` // project name Title string `json:"title,omitempty" default:"HiBoot Demo Application"` // project name Project string `json:"project,omitempty" default:"hidevopsio"` // app name Name string `json:"name,omitempty" default:"hiboot-app"` // app description Description string `json:"description,omitempty" default:"${app.name} is a Hiboot Application"` // profiles Profiles Profiles `json:"profiles"` // banner Banner banner // Version Version string `json:"version,omitempty" default:"${APP_VERSION:v1}"` // TermsOfService TermsOfService string `json:"termsOfService,omitempty"` Contact *ContactInfo `json:"contact,omitempty"` License *License `json:"license,omitempty"` }
App is the properties of the application, it hold the base info of the application
type Builder ¶
type Builder interface { Init() error Build(profiles ...string) (p interface{}, err error) BuildWithProfile(profile string) (interface{}, error) Load(properties interface{}, opts ...func(*mapstructure.DecoderConfig)) (err error) Save(p interface{}) (err error) Replace(source string) (retVal interface{}) GetProperty(name string) (retVal interface{}) SetProperty(name string, val interface{}) Builder SetDefaultProperty(name string, val interface{}) Builder SetConfiguration(in interface{}) }
Builder is the config file (yaml, json) builder
type ConfigFile ¶ added in v1.3.0
type ConfigFile struct {
// contains filtered or unexported fields
}
type Configuration ¶
type Configuration struct { at.AutoConfiguration App *App Server *Server Logging *Logging }
Configuration is the system configuration
func NewConfiguration ¶ added in v1.3.0
func NewConfiguration(app *App, server *Server, logging *Logging) *Configuration
type ContactInfo ¶ added in v1.3.0
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 License ¶ added in v1.3.0
type Logging ¶
type Logging struct { // annotation at.ConfigurationProperties `value:"logging" json:"-"` Level string `json:"level,omitempty" default:"info"` }
Logging is the properties of logging
type Profiles ¶
type Profiles struct { // included profiles Include []string `json:"include,omitempty"` // active profile Active string `json:"active,omitempty" default:"default"` }
Profiles is app profiles .include auto configuration starter should be included inside this slide .active active profile
type Server ¶
type Server struct { // annotation at.ConfigurationProperties `value:"server" json:"-"` Schemes []string `json:"schemes,omitempty" default:"http"` Host string `json:"host,omitempty" default:"localhost:8080"` Port string `json:"port,omitempty" default:"8080"` ContextPath string `json:"context_path,omitempty" default:"/"` }
Server is the properties of http server