server

package
v1.1.0-dotfiles Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: Unlicense Imports: 12 Imported by: 0

Documentation

Overview

Package server defines internal behaviour.

Package server defines internal behaviour.

Package server defines internal behaviour.

Package server defines internal behaviour.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(w http.ResponseWriter, code int, message string)

Error explains what went wrong.

func JSON

func JSON(w http.ResponseWriter, code int, payload interface{})

JSON marshals a JSON payload and writes it out to the response, with some headers.

func JSONWithCookie

func JSONWithCookie(w http.ResponseWriter, code int, payload interface{}, cookie http.Cookie)

JSONWithCookie marshals a JSON payload, sets a cookie, and writes out to the response, with some headers.

func NewUserRouter

func NewUserRouter(u root.UserService, router *mux.Router) *mux.Router

NewUserRouter sets up a Router with some functions to handle various routes.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server holds a router.

func NewServer

func NewServer(u root.UserService) *Server

NewServer returns an Server initialised with the given UserService.

func (*Server) Start

func (s *Server) Start()

Start will start the Server listening.

Jump to

Keyboard shortcuts

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