listener

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 Initialize added in v1.1.2

func Initialize() error

Initialize loads all listeners from the pesisted state ensuring at least one exists

func Listeners

func Listeners() map[string]Listener

Listeners return a copy of the listeners in the current state

func LoadFromPersistedState added in v1.1.2

func LoadFromPersistedState() error

LoadFromPersistedState loads all listeners from the files in the configuration directory into memory

func RequestHandlingChanged added in v1.1.0

func RequestHandlingChanged(result event.HandleResult)

RequestHandlingChanged stores or update the handle result

func Save added in v1.1.2

func Save(toSave *Listener) error

Save saves a listener to it's file, or to the default file if not specified

func SaveToPersistedState added in v1.1.2

func SaveToPersistedState() error

SaveToPersistedState save all listeners back to files

func StartListening

func StartListening()

StartListening initializes all the listeners and bind them to the specified ports

Types

type Listener

type Listener struct {
	CertificateFile  string               `json:"certificateFile" yaml:"certificateFile"`
	EnabledUpstreams []string             `json:"enabledUpstreams" yaml:"enabledUpstreams"`
	KeyFile          string               `json:"keyFile" yaml:"keyFile"`
	Name             string               `json:"name"`
	Origin           configuration.Origin `json:"-" yaml:"-"`
	Port             int                  `json:"port"`
}

Listener represents a listener that responds to incoming requests

Jump to

Keyboard shortcuts

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