server

package
v0.2.38 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

View Source
const (
	StartupEvent         EventName = "startup"
	ShutdownEvent                  = "shutdown"
	CertRenewEvent                 = "certrenew"
	InstanceStartupEvent           = "instancestartup"
	InstanceRestartEvent           = "instancerestart"
	RegistryChangeEvent            = "registryChange"
	//ConfigChangeEvent should use the all config data as info
	ConfigChangeEvent = "configChange"
)

Variables

This section is empty.

Functions

func EmitEvent

func EmitEvent(event EventName, info interface{})

EmitEvent executes the different hooks passing the EventType as an argument. This is a blocking function. Hook developers should use 'go' keyword if they don't want to block Caddy.

func RegisterEventHook

func RegisterEventHook(name string, hook EventHook) error

Types

type EventHook

type EventHook func(eventType EventName, eventInfo interface{}) error

type EventName

type EventName string

type Options

type Options struct {
	ServerName string
	Address    string
}

type Server

type Server interface {
	Run(graceful func())
	Shutdown()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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