api

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppRespErrors appErrorsStruct

AppRespErrors variable

Functions

func BuildAppErrors

func BuildAppErrors()

BuildAppErrors builds all the error messages that the app

func InitMetaHandlers

func InitMetaHandlers(r *mux.Router, prefix string)

InitMetaHandlers starts the meta api handlers

func OpenRouteHandler

func OpenRouteHandler(path string, r *mux.Router, f http.Handler)

OpenRouteHandler is utilised for unprotected routes (non-JWT)

func RouteBuilder

func RouteBuilder(prefix string, namespace string, version string, method string) string

RouteBuilder takes prefix, namespace, version, and method params :: returns formatted route

Types

type Response

type Response struct {
	Data   interface{} `json:"data,omitempty"`
	Meta   interface{} `json:"meta,omitempty"`
	Errors []errorCode `json:"errors,omitempty"`
}

Response is the generic resp that will be used for the api

func (*Response) Send

func (i *Response) Send(w http.ResponseWriter)

Send marshal the response and write value

Jump to

Keyboard shortcuts

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