components

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ComponentCache = xcore.NewXCache("component", 0, 0)
View Source
var Components = map[string]Component{}
View Source
var ComponentsOrder = []string{}

Functions

func Link()

LinkComponents will call all the server components and link them with the system ready to use to link with the handler Link the components. NOTE THE ORDER IS VERY VERY IMPORTANT

func StartHost added in v1.5.1

func StartHost()

Types

type Component

type Component interface {
	// Start is called when the system starts. Only once at the beginning. .
	Start()
	// StartHost is called every time the host is started. The host is started when the system starts
	//   and also every time the configuration is reloaded: means when the component configuration may have changed
	StartHost(host *config.Host)
	// NeedHandler is called when the listener starts to know if the handler must be linked with the system.
	NeedHandler() bool
	// Hanger is the hander to link with the listener when needed
	Handler(handler http.HandlerFunc) http.HandlerFunc
}

Component interface: all the built-in and external components must respect this interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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