handlers

package
v0.0.0-...-12c9185 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2018 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrFailedToUnmarshalJSON request body processing error
	ErrFailedToUnmarshalJSON = errors.New("Failed to Unmarshal JSON")
	//ErrFailedToReadBody request body processing error
	ErrFailedToReadBody = errors.New("Failed to read request body")
	//ErrSomethingWrong request body processing error
	ErrSomethingWrong = errors.New("Something is wrong")
	//ErrInvalidRequest request body processing error
	ErrInvalidRequest = errors.New("Invalid Request Against this endpoint")
)

Functions

func RenderError

func RenderError(res http.ResponseWriter, err error, customMessages ...string) error

RenderError help handler create a consistent error response

Types

type StoryHandler

type StoryHandler struct {
	StoryService story.Service
	CacheService chronicle.CacheService
}

func (StoryHandler) RegisterRoutes

func (h StoryHandler) RegisterRoutes(router *mux.Router)

type TopicHandler

type TopicHandler struct {
	TopicService topic.Service
	CacheService chronicle.CacheService
}

func (TopicHandler) RegisterRoutes

func (h TopicHandler) RegisterRoutes(router *mux.Router)

Jump to

Keyboard shortcuts

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