server

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

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 EventName, hook ...EventHook) error

Types

type Error added in v0.6.17

type Error struct {
	Code   string
	Msg    string
	SubMsg string
	Result bool
}

func NewError added in v0.6.17

func NewError(msg string) *Error

func NewErrorAllMsg added in v0.6.17

func NewErrorAllMsg(msg, subMsg string) *Error

func NewErrorSubMsg added in v0.6.17

func NewErrorSubMsg(subMsg string) *Error

func (Error) Error added in v0.6.17

func (e Error) Error() string

type EventHook

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

type EventName

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

type Options

type Options struct {
	ServerName  string
	Address     string
	Concurrency int
	IdleTimeout time.Duration
}

type Server

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

Directories

Path Synopsis
lb

Jump to

Keyboard shortcuts

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