Documentation ¶
Overview ¶
Package app provides abstract layer for cli/web application
Package app provides hiboot app application interface
Index ¶
- Constants
- Variables
- func AutoConfiguration(params ...interface{}) (err error)
- func Register(params ...interface{}) (err error)
- func RegisterPostProcessor(p ...interface{})
- type Application
- type ApplicationContext
- type BaseApplication
- func (a *BaseApplication) AfterInitialization(configs ...cmap.ConcurrentMap)
- func (a *BaseApplication) AppendProfiles(app Application) error
- func (a *BaseApplication) BuildConfigurations()
- func (a *BaseApplication) ConfigurableFactory() *autoconfigure.ConfigurableFactory
- func (a *BaseApplication) GetInstance(name string) (instance interface{})
- func (a *BaseApplication) GetProperty(name string) (value interface{}, ok bool)
- func (a *BaseApplication) Initialize() error
- func (a *BaseApplication) PrintStartupMessages()
- func (a *BaseApplication) RegisterController(controller interface{}) error
- func (a *BaseApplication) Run() error
- func (a *BaseApplication) SetProperty(name string, value interface{}) Application
- func (a *BaseApplication) SystemConfig() *system.Configuration
- func (a *BaseApplication) Use(handlers ...context.Handler)
- type Configuration
- type PostConfiguration
- type PostProcessor
- type PreConfiguration
Constants ¶
const ( // PropertyBannerDisabled is the property that allow use to enable / disable banner display on terminal PropertyBannerDisabled = "property.banner.disabled" // PropertyAppProfilesInclude is the property that allow user include profiles at runtime PropertyAppProfilesInclude = "property.app.profiles.include" )
Variables ¶
var Component = Register
Component register all component into container
var ( // ErrInvalidObjectType indicates that configuration type is invalid ErrInvalidObjectType = errors.New("[app] invalid Configuration type, one of app.Configuration, app.PreConfiguration, or app.PostConfiguration need to be embedded") )
Functions ¶
func AutoConfiguration ¶
func AutoConfiguration(params ...interface{}) (err error)
AutoConfiguration register auto configuration struct
func Register ¶ added in v0.9.0
func Register(params ...interface{}) (err error)
Register register a struct instance or constructor (func), so that it will be injectable.
func RegisterPostProcessor ¶
func RegisterPostProcessor(p ...interface{})
Types ¶
type Application ¶
type ApplicationContext ¶ added in v0.5.4
type BaseApplication ¶
type BaseApplication struct { WorkDir string // contains filtered or unexported fields }
func (*BaseApplication) AfterInitialization ¶
func (a *BaseApplication) AfterInitialization(configs ...cmap.ConcurrentMap)
AfterInitialization post initialization
func (*BaseApplication) AppendProfiles ¶ added in v0.9.0
func (a *BaseApplication) AppendProfiles(app Application) error
AppendProfiles Run run the application
func (*BaseApplication) BuildConfigurations ¶
func (a *BaseApplication) BuildConfigurations()
BuildConfigurations get BuildConfigurations
func (*BaseApplication) ConfigurableFactory ¶
func (a *BaseApplication) ConfigurableFactory() *autoconfigure.ConfigurableFactory
ConfigurableFactory get ConfigurableFactory
func (*BaseApplication) GetInstance ¶ added in v0.7.1
func (a *BaseApplication) GetInstance(name string) (instance interface{})
GetInstance get application instance by name
func (*BaseApplication) GetProperty ¶ added in v0.5.8
func (a *BaseApplication) GetProperty(name string) (value interface{}, ok bool)
GetProperty get application property
func (*BaseApplication) Initialize ¶ added in v0.6.0
func (a *BaseApplication) Initialize() error
Initialize init application
func (*BaseApplication) PrintStartupMessages ¶ added in v0.5.8
func (a *BaseApplication) PrintStartupMessages()
PrintStartupMessages prints startup messages
func (*BaseApplication) RegisterController ¶
func (a *BaseApplication) RegisterController(controller interface{}) error
RegisterController register controller by interface
func (*BaseApplication) Run ¶ added in v0.7.1
func (a *BaseApplication) Run() error
Run run the application
func (*BaseApplication) SetProperty ¶ added in v0.5.8
func (a *BaseApplication) SetProperty(name string, value interface{}) Application
SetProperty set application property
func (*BaseApplication) SystemConfig ¶
func (a *BaseApplication) SystemConfig() *system.Configuration
Config returns application config
func (*BaseApplication) Use ¶
func (a *BaseApplication) Use(handlers ...context.Handler)
Use use middleware handlers
type Configuration ¶
type Configuration interface{}
type PostConfiguration ¶
type PostConfiguration interface{}
type PostProcessor ¶
type PostProcessor interface {
AfterInitialization(factory interface{})
}
type PreConfiguration ¶
type PreConfiguration interface{}
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package cli provides quick start framework for command line application.
|
Package cli provides quick start framework for command line application. |
Package fake provides fake.ApplicationContext for unit testing
|
Package fake provides fake.ApplicationContext for unit testing |
Package web provides quick start framework for web application.
|
Package web provides quick start framework for web application. |
annotation
Package web/annotation provides annotations for web RestController
|
Package web/annotation provides annotations for web RestController |