httpcmp

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerLive lifeState = iota
	ServerReady
	ServerShuttingDown
	ServerShuttedDown
)

lifecycle states

Variables

This section is empty.

Functions

This section is empty.

Types

type InitializedEvent

type InitializedEvent struct{}

InitializedEvent is emitted when the server will be started directly afterwards.

type Server

type Server interface {
	// Middleware
	Use(middlewares ...func(http.Handler) http.Handler)
	// Generic routing
	Handle(pattern string, handler http.Handler)
	HandleFunc(pattern string, handlerFunc http.HandlerFunc)
	// HTTP-method routing`
	Connect(pattern string, handlerFunc http.HandlerFunc)
	Delete(pattern string, handlerFunc http.HandlerFunc)
	Get(pattern string, handlerFunc http.HandlerFunc)
	Head(pattern string, handlerFunc http.HandlerFunc)
	Options(pattern string, handlerFunc http.HandlerFunc)
	Patch(pattern string, handlerFunc http.HandlerFunc)
	Post(pattern string, handlerFunc http.HandlerFunc)
	Put(pattern string, handlerFunc http.HandlerFunc)
	Trace(pattern string, handlerFunc http.HandlerFunc)
	// Server control
	Shutdown()
}

type ShutDownCompletedEvent

type ShutDownCompletedEvent struct{}

ShutDownCompletedEvent is emitted when the server is stopped.

type ShutDownInitiatedEvent

type ShutDownInitiatedEvent struct{}

ShutDownInitiatedEvent is emitted when the server will be stopped directly afterwards.

Jump to

Keyboard shortcuts

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