kernel

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "0.0.1"

Variables

View Source
var (
	Timezone    string
	TimezoneSet bool
)

Functions

This section is empty.

Types

type Application

type Application struct {
	container.Container
	// contains filtered or unexported fields
}

func NewApp

func NewApp(env string, debug bool, basePath string) *Application

func (*Application) BindRuntime

func (a *Application) BindRuntime(abs interface{}, instance interface{}, singleton bool)

BindRuntime bind request lift time object to container object can be injection to route handler

func (*Application) BindRuntimeFunc

func (a *Application) BindRuntimeFunc(abs interface{}, register container.InstanceRegister, singleton bool)

func (*Application) Bootstrap

func (a *Application) Bootstrap()

func (*Application) ConfigRuntime added in v0.0.2

func (a *Application) ConfigRuntime(h RuntimeHolder)

ConfigRuntime handle runtime app before its returns

func (*Application) Configure

func (a *Application) Configure(name string, to interface{}) error

func (*Application) Debug

func (a *Application) Debug() bool

func (*Application) Defer

func (a *Application) Defer(cb Cb)

/ Defer run your function before server down

func (*Application) Env

func (a *Application) Env() string

func (*Application) GetBasePath

func (a *Application) GetBasePath() string

func (*Application) GetConfigPath

func (a *Application) GetConfigPath() string

func (*Application) NewRuntime

func (a *Application) NewRuntime() *Application

func (*Application) RegisterController

func (a *Application) RegisterController(name string, controller interface{})

func (*Application) RegisterServiceProvider

func (a *Application) RegisterServiceProvider(provider ServiceProvider)

func (*Application) RunDefers

func (a *Application) RunDefers()

func (*Application) RuntimeRegisters

func (a *Application) RuntimeRegisters() []*RuntimeRegisters

func (*Application) Terminate

func (a *Application) Terminate()

func (*Application) TerminateWith

func (a *Application) TerminateWith(f Cb)

TerminateWith run your function at end of request life time

type Cb

type Cb func()

type RuntimeHolder added in v0.0.2

type RuntimeHolder func(runtime *Application)

type RuntimeRegisters

type RuntimeRegisters struct {
	// contains filtered or unexported fields
}

func (*RuntimeRegisters) Abs

func (r *RuntimeRegisters) Abs() interface{}

func (*RuntimeRegisters) Instance

func (r *RuntimeRegisters) Instance() interface{}

func (*RuntimeRegisters) Singleton

func (r *RuntimeRegisters) Singleton() bool

type ServiceProvider

type ServiceProvider interface {
	// Register your service provider when app starting
	//
	Register(app *Application)
	// Boot your service provider when app started
	//
	Boot(app *Application)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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