api

package
v0.0.0-...-7ba06b6 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: MIT Imports: 7 Imported by: 12

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 CheckHashDetails

func CheckHashDetails(username string, password string, hash string) bool

CheckHashDetails takes username, password, hash - returns checked version

func HashDetails

func HashDetails(username string, password string) (string, error)

HashDetails takes username and password - returns hash

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)

func ProtectedRouteHandler

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

func RouteBuilder

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

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
JackTT - Gopher 🇻🇳