internal

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error interface {
	error
	Status() int
}

Error represents a handler error. It provides methods for a HTTP status code and embeds the built-in error interface.

type Server

type Server struct {
	LogFile         string
	Port            int `valid:"range(1|65535)~'port' must be a valid port between 1-65535, required~Port must be specified"`
	Router          *httprouter.Router
	MaxShutdownTime time.Duration
	Info            ServerInfo
	IsHealthy       int32
	Verbose         bool
}

Server describes the server configuration

func (*Server) Start

func (s *Server) Start()

Start initializes a server instance and start the server

type ServerInfo added in v0.0.4

type ServerInfo struct {
	Version string
	Commit  string
	Date    string
	BuiltBy string
}

ServerInfo contains some metadata about the server

type StatusError

type StatusError struct {
	Code int
	Err  error
}

StatusError represents an error with an associated HTTP status code.

func (StatusError) Error

func (se StatusError) Error() string

Allows StatusError to satisfy the error interface.

func (StatusError) Status

func (se StatusError) Status() int

Status returns our HTTP status code.

Jump to

Keyboard shortcuts

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