controllers

package
v0.0.0-...-3220a8e Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ERRORS = "errors"

ERRORS ...

Variables

This section is empty.

Functions

func HandleGetResponse

func HandleGetResponse(c context.Context, w http.ResponseWriter, err *utils.JSONAPIError, result utils.Renderable)

HandleGetResponse marshals the result and renders it to the response

func HandlePostResponse

func HandlePostResponse(c context.Context, w http.ResponseWriter, success bool, err *utils.JSONAPIError, resource utils.Renderable)

HandlePostResponse => wraps json-api handler

func JSON

func JSON(c context.Context, w http.ResponseWriter, status int, v interface{})

JSON => Add content type to Json and Marshel Json header data

func SayError

func SayError(w http.ResponseWriter, r *http.Request)

SayError returns a 500

func SayOK

func SayOK(w http.ResponseWriter, r *http.Request)

SayOK returns a 200

Types

type MainController

type MainController struct {
	Postalcode      pc.IPostalCode
	ContactHandler  ch.IContact
	CustomerHandler ch.ICustomer
}

MainController struct

func GetMainController

func GetMainController(postalcode pc.IPostalCode, contactHandler ch.IContact, customerHandler ch.ICustomer) *MainController

GetMainController ...

func (*MainController) HandleCreateCustomer

func (m *MainController) HandleCreateCustomer(w http.ResponseWriter, r *http.Request)

HandleCreateCustomer ...

func (*MainController) HandleLegacyPostalCodeLookup

func (m *MainController) HandleLegacyPostalCodeLookup(w http.ResponseWriter, r *http.Request)

HandleLegacyPostalCodeLookup returns rating data for a postal code, wrapped in a legacy struct

func (*MainController) HandlePostalCodeLookup

func (m *MainController) HandlePostalCodeLookup(w http.ResponseWriter, r *http.Request)

HandlePostalCodeLookup ...

Jump to

Keyboard shortcuts

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