httpd

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	Port     int
	CertFile string
	KeyFile  string
}

Conf is the required config to create httpd server

type FileWatcher

type FileWatcher interface {
	Close() error
}

FileWatcher is an interface we use to watch changes in files

func NewFileWatcher

func NewFileWatcher(file string, onEvent func()) (FileWatcher, error)

NewFileWatcher creates a new FileWatcher

type OSFileWatcher

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

OSFileWatcher defines a watch over a file

func (OSFileWatcher) Close

func (f OSFileWatcher) Close() error

Close ends the watch

type Route

type Route func(http.ResponseWriter, *http.Request)

Route is the signature of the route handler

type SimpleServer

type SimpleServer interface {
	Port() int
	AddRoute(string, Route)
	Start(chan error)
	Shutdown()
}

SimpleServer is a simple http server supporting TLS

func NewSimpleServer

func NewSimpleServer(conf Conf) SimpleServer

NewSimpleServer is a factory function to create an instance of SimpleServer

Jump to

Keyboard shortcuts

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