Documentation
¶
Index ¶
- func ActivateListener(newConfig ListenerConfiguration)
- func GetRequests() map[string]event.HandleResult
- func Listeners() map[int]Listener
- func RequestHandlingChanged(result event.HandleResult)
- func SetEnabledUpstreams(listenerPort int, upstreamsToEnable []string)
- func SetListeners(listenersToSet map[int]Listener)
- func StartListening(configurations []ListenerConfiguration)
- type Listener
- type ListenerConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActivateListener ¶
func ActivateListener(newConfig ListenerConfiguration)
ActivateListener activates the lister matched by port and copy the configuration passed in. Enabled upstreams are keptd intact if the lister already exist in the current map of listeners.
func GetRequests ¶ added in v1.1.0
func GetRequests() map[string]event.HandleResult
GetRequests return an array of handle result sorted by started time
func RequestHandlingChanged ¶ added in v1.1.0
func RequestHandlingChanged(result event.HandleResult)
RequestHandlingChanged stores or update the handle result
func SetEnabledUpstreams ¶
SetEnabledUpstreams sets the array of upstreams that are enabled for a specific listener
func SetListeners ¶
SetListeners reset the current listeners to a new state
func StartListening ¶
func StartListening(configurations []ListenerConfiguration)
StartListening initializes all the listeners and bind them to the specified ports
Types ¶
type Listener ¶
type Listener struct {
Active bool `json:"active"`
Configuration ListenerConfiguration `json:"configuration"`
EnabledUpstreams []string `json:"enabledUpstreams"`
}
Listener represents a listener that responds to incoming requests
type ListenerConfiguration ¶
type ListenerConfiguration struct {
CertificateFile string `json:"certificateFile"`
KeyFile string `json:"keyFile"`
Name string `json:"name"`
Port int `json:"port"`
}
ListenerConfiguration store the configuration to create a listener
func ParseListenerConfigurations ¶
func ParseListenerConfigurations() []ListenerConfiguration
ParseListenerConfigurations reads environment variables and parses the relevant keys to create the configurations