web

package
v0.0.0-...-4adff92 Latest Latest
Warning

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

Go to latest
Published: May 12, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(router *mux.Router, service *Service)

RegisterHandlers registers the service in the HTTP handler mux. IMPORTANT: all routes SHOULD have a name

Types

type Service

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

Service contains the main controller logic.

func NewService

func NewService(opts ...ServiceOption) *Service

NewService creates a new service object.

func (*Service) Home

func (s *Service) Home(w http.ResponseWriter, r *http.Request)

Home represents the main route.

type ServiceOption

type ServiceOption func(s *Service)

ServiceOption sets options in the Service.

func ErrorHandler

func ErrorHandler(l emperror.Handler) ServiceOption

ErrorHandler returns a ServiceOption that sets the error handler for the service.

func Logger

func Logger(l log.Logger) ServiceOption

Logger returns a ServiceOption that sets the logger for the service.

Jump to

Keyboard shortcuts

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