server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPServer

type HTTPServer struct {
	http.Server
}

HTTPServer is a wrapper for an http server that implements the server interface.

func (*HTTPServer) Close

func (*HTTPServer) Close()

Close does nothing but exists to satisfy the server interface.

func (*HTTPServer) Start

func (s *HTTPServer) Start() error

Start starts the http server. Always returns a non-nil error.

type HTTPTestServer

type HTTPTestServer struct {
	*httptest.Server
}

HTTPTestServer is a wrapper for an httptest server that implements the server interface.

func (*HTTPTestServer) Start

func (s *HTTPTestServer) Start() error

Start start the server. Always returns a nil error.

type Runner

type Runner struct {
	Server Server
}

func CreateHTTPServerRunner

func CreateHTTPServerRunner(routerFactory router.RouterFactory) Runner

CreateHTTPServerRunner creates a new Runner using an HTTPServer.

func CreateHTTPTestServerRunner

func CreateHTTPTestServerRunner(routerFactory router.RouterFactory) Runner

CreateHTTPTestServerRunner creates a new Runner using an HTTPTestServer.

func (Runner) Run

func (s Runner) Run() error

Run runs the server and returns any errors.

type Server

type Server interface {
	// Start starts the server and returns any errors encountered while it is running.
	Start() error

	// Close closes the server.
	Close()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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