server

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidDirectory = errors.New("directory does not exist")

ErrInvalidDirectory indicates that the provided directory does not exist

Functions

This section is empty.

Types

type Static

type Static struct {
	Port      int    // Port the server runs on. Uses the next available port if one is not provided.
	Cert      string // Location of a certificate file for TLS
	Key       string // Location of a key file for TLS
	Directory string // Directory the files should be served from
	// contains filtered or unexported fields
}

Static is a static file server.

Files may be accessed via the route `/camera`.

func (*Static) ListenAndServe

func (stcsrv *Static) ListenAndServe() error

ListenAndServe begins listening on the configured port and serving static files.

func (*Static) Shutdown

func (stcsrv *Static) Shutdown(timout time.Duration) error

Shutdown gracefully shuts down the server with a deadline.

Gives active connections the opportunity to finish their work within the given time period before ultimately closing all connections and shutting everything down.

Jump to

Keyboard shortcuts

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