server

package
v0.0.0-...-ed7ff26 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HTTP/1.1 without TLS
	MODE_PLAIN = "plain"
	// HTTP/1.1 and HTTP/2 with TLS
	MODE_TLS = "tls"
	// HTTP/1.1 and HTTP/2 without TLS
	MODE_H2C = "h2c"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Ctx    context.Context
	Router *chi.Mux
}

func New

func New() *Server

func (*Server) Start

func (s *Server) Start(mode string, addr string, jobmanager jobs.JobManager) error

Start the server and sets up graceful shutdown. Expects mode to be one of MODE_PLAIN, MODE_TLS, or MODE_H2C. If mode is invalid, will assume MODE_PLAIN which may not be the best default, but the preferred would require a TLS certificate and key to be set.

Will block.

Jump to

Keyboard shortcuts

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