server

package
v0.0.0-...-6ebec13 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(o *Options)

Run the server, get them logs flowing

Types

type Default

type Default struct {
	// contains filtered or unexported fields
}

Default is the default request handler

func (*Default) Handle

func (d *Default) Handle(w http.ResponseWriter, r *http.Request)

Handle the request and write a response

func (*Default) Start

func (d *Default) Start()

Start the HealthCheck

func (*Default) Stop

func (d *Default) Stop()

Stop signals that the shutdown process has begun

type Echo

type Echo struct {
	// contains filtered or unexported fields
}

Echo handler wrapper

func (*Echo) Handle

func (e *Echo) Handle(w http.ResponseWriter, r *http.Request)

Handle websocket requests by replying with the received message

func (*Echo) Start

func (e *Echo) Start()

Start the Echo... echo... echo

func (*Echo) Stop

func (e *Echo) Stop()

Stop signals that the shutdown process has begun

type Handler

type Handler interface {
	Handle(http.ResponseWriter, *http.Request)
	Start()
	Stop()
}

Handler provides lifecycle hooks for an HttpHandler

type HealthCheck

type HealthCheck struct {
	// contains filtered or unexported fields
}

HealthCheck provides a handler for health check requests

func (*HealthCheck) Handle

func (h *HealthCheck) Handle(w http.ResponseWriter, r *http.Request)

Handle healcheck requests

func (*HealthCheck) Start

func (h *HealthCheck) Start()

Start the HealthCheck

func (*HealthCheck) Stop

func (h *HealthCheck) Stop()

Stop signals that the shutdown process has begun

type Options

type Options struct {
	ShutdownDelaySeconds int
	ListenPort           int
}

Options is used to configure the server

Jump to

Keyboard shortcuts

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