server

package
v0.0.0-...-716047f Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RoutedService

type RoutedService interface {
	RegisterRoutes(*chi.Mux)
}

type Server

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

func NewServer

func NewServer(address string, config ServerConfig) *Server

func (*Server) Listen

func (s *Server) Listen() error

Listen starts the server on the address given in the server configuration.

func (*Server) Router

func (s *Server) Router() *chi.Mux

Router returns server router

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown the server gracefully with a 30 second timeout

type ServerConfig

type ServerConfig struct {
	Profile bool
	Metrics bool
}

type TestServer

type TestServer struct {
	http.Handler
}

func NewTestServer

func NewTestServer(service RoutedService) *TestServer

NewTestServer creates a new test server based on the provided routed service

func (*TestServer) Request

Jump to

Keyboard shortcuts

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