httpserver

package
v0.0.0-...-e75b798 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: Apache-2.0 Imports: 14 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 {
	// contains filtered or unexported fields
}

func New

func New(hub *wsnotify.Hub, port int) (*HTTPServer, error)

func (*HTTPServer) Close

func (srv *HTTPServer) Close() error

Close stops listening and deinitializes HTTP server

func (*HTTPServer) Run

func (srv *HTTPServer) Run() error

Run initializes and starts HTTP server

type HTTPStatusError

type HTTPStatusError interface {
	error
	HTTPStatusCode() int
}

HTTPStatusError allows to return errors which can be converted to proper HTTP status codes.

type JSONErrorStruct

type JSONErrorStruct struct {
	Msg  string `json:"msg"`
	Code int    `json:"code"`
}

JSONErrorStruct is a struct to be marshaled to JSON and reporting to the HTTP client.

Jump to

Keyboard shortcuts

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