common

package
v0.0.0-...-8c606a7 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Port     int `yaml:"port"`
	Interval int `yaml:"interval"`
}
var Config Configuration

type HTTPError

type HTTPError struct {
	// Message to log in console
	Message string
	// Status code that'll be sent in response
	StatusCode int
}

func ReadAndServeFile

func ReadAndServeFile(name string, w http.ResponseWriter) *HTTPError

ReadAndServeFile reads the file from specified location and sends it in response

type Handler

type Handler func(rc *RouterContext, w http.ResponseWriter, r *http.Request) *HTTPError

Handler is the signature of HTTP Handler that is passed to Handle function

type RouterContext

type RouterContext struct{}

RouterContext contains any information to be shared with middlewares.

Jump to

Keyboard shortcuts

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