server

package
v0.0.0-...-881765e Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger(inner http.Handler, name string) http.Handler

Logger function for http calls

Types

type App

type App interface {
	Run()
}

App ... main application structure

func NewApp

func NewApp() App

NewApp returns an application instance this is the primary stateless server providing an API interface

type HTTPResponder

type HTTPResponder interface {
	JSON(w http.ResponseWriter, code int, payload interface{})
	ERROR(w http.ResponseWriter, code int, err error)
}

HTTPResponder serves method to respond to http calls

type ItemTemplateHandler

type ItemTemplateHandler interface {
	GetItemTemplates(w http.ResponseWriter, r *http.Request)
	GetItemTemplateByTemplateID(w http.ResponseWriter, r *http.Request)
}

ItemTemplateHandler is the public item handler interface

func NewItemTemplatesHandler

func NewItemTemplatesHandler(its service.ItemTemplatesService, httpResponder HTTPResponder) ItemTemplateHandler

NewItemTemplatesHandler creates a new item handler

type Route

type Route struct {
	Pattern     string
	Method      string
	Name        string
	HandlerFunc http.Handler
}

Route ... contains data to declare a route

type Routes

type Routes []Route

Routes ... type to hold multiple routes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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