app

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package app provides abstract layer for cli/web application

Package app provides hiboot app application interface

Index

Constants

View Source
const (
	PropertyBannerDisabled = "property.banner.disabled"
)

Variables

View Source
var (
	InvalidObjectTypeError        = errors.New("[app] invalid Configuration type, one of app.Configuration, app.PreConfiguration, or app.PostConfiguration need to be embedded")
	ConfigurationNameIsTakenError = errors.New("[app] configuration name is already taken")
	ComponentNameIsTakenError     = errors.New("[app] component name is already taken")
)

Functions

func AutoConfiguration

func AutoConfiguration(params ...interface{}) (err error)

AutoConfiguration register auto configuration struct

func Component

func Component(params ...interface{}) (err error)

Component register a struct instance, so that it will be injectable. starter should register component type

func RegisterPostProcessor

func RegisterPostProcessor(p ...PostProcessor)

Types

type Application

type Application interface {
	Initialize() error
	SetProperty(name string, value interface{}) Application
	Run() error
}

type ApplicationContext added in v0.5.4

type ApplicationContext interface {
	RegisterController(controller interface{}) error
	Use(handlers ...context.Handler)
	GetProperty(name string) (value interface{}, ok bool)
}

type BaseApplication

type BaseApplication struct {
	WorkDir string
	// contains filtered or unexported fields
}

func (*BaseApplication) AfterInitialization

func (a *BaseApplication) AfterInitialization(configs ...cmap.ConcurrentMap)

func (*BaseApplication) BeforeInitialization

func (a *BaseApplication) BeforeInitialization()

func (*BaseApplication) BuildConfigurations

func (a *BaseApplication) BuildConfigurations()

func (*BaseApplication) ConfigurableFactory

func (a *BaseApplication) ConfigurableFactory() *autoconfigure.ConfigurableFactory

func (*BaseApplication) GetProperty added in v0.5.8

func (a *BaseApplication) GetProperty(name string) (value interface{}, ok bool)

GetProperty

func (*BaseApplication) Initialize added in v0.6.0

func (a *BaseApplication) Initialize() error

Init

func (*BaseApplication) PrintStartupMessages added in v0.5.8

func (a *BaseApplication) PrintStartupMessages()

BeforeInitialization ?

func (*BaseApplication) RegisterController

func (a *BaseApplication) RegisterController(controller interface{}) error

func (*BaseApplication) SetProperty added in v0.5.8

func (a *BaseApplication) SetProperty(name string, value interface{})

SetProperty

func (*BaseApplication) SystemConfig

func (a *BaseApplication) SystemConfig() *system.Configuration

Config returns application config

func (*BaseApplication) Use

func (a *BaseApplication) Use(handlers ...context.Handler)

type Configuration

type Configuration interface{}

type PostConfiguration

type PostConfiguration interface{}

type PostProcessor

type PostProcessor interface {
	BeforeInitialization(factory interface{})
	AfterInitialization(factory interface{})
}

type PreConfiguration

type PreConfiguration interface{}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL