rest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2017 License: BSD-3-Clause Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DEBUG   string = "DEBUG"
	INFO    string = "INFO"
	WARNING string = "WARN"
	ERROR   string = "ERROR"
	FATAL   string = "FATAL"
)

Log levels

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Router *httprouter.Router
	Config ServerConfig
}

Server is the REST API server for Minimal Chat

func Initialize

func Initialize(ds *store.InMemory, config ServerConfig) *Server

Listen starts listening on `port` and `host`

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ServerConfig

type ServerConfig struct {
	Protocol string
	Port     int
	Host     string

	SSLCertFile string
	SSLKeyFile  string
	SSLPort     int

	CORSOrigin  string
	CORSEnabled bool
}

Jump to

Keyboard shortcuts

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