web

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRequestEventBus

func GetRequestEventBus(requestObj *http.Request) commonEventBus.EventBus

func RequestContextAppend

func RequestContextAppend(requestObj *http.Request, key, val interface{})

Types

type Controller

type Controller func(*http.Request) response.Response

type Kernel

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

func NewKernel

func NewKernel(configPath string) (*Kernel, error)

func (*Kernel) GetContainer

func (k *Kernel) GetContainer() *gioc.Container

func (*Kernel) GetEventsRegistry

func (k *Kernel) GetEventsRegistry() *commonEventBus.EventsRegistry

func (*Kernel) GetHttpServer

func (k *Kernel) GetHttpServer() *http.Server

func (*Kernel) GetTemplates

func (k *Kernel) GetTemplates() *template.Template

func (*Kernel) RegisterListener

func (k *Kernel) RegisterListener(eventObj commonEvent.Event, listenerFunc interface{}, priority int) error

func (*Kernel) RegisterListenerForRoute

func (k *Kernel) RegisterListenerForRoute(routeName string, eventObj commonEvent.Event, listenerFunc interface{}, priority int) error

func (*Kernel) RegisterRoute

func (k *Kernel) RegisterRoute(route *Route) *Kernel

func (*Kernel) RegisterService

func (k *Kernel) RegisterService(alias string, factoryMethod interface{}, enableCaching bool) error

func (*Kernel) Run

func (k *Kernel) Run()

type Route

type Route struct {
	Name           string
	Methods        []string
	Url            string
	Controller     Controller
	Timeout        time.Duration
	TimeoutHandler TimeoutHandler
	// contains filtered or unexported fields
}

type TimeoutHandler added in v1.1.0

type TimeoutHandler func() response.Response

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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