api

package
v0.0.0-...-9de49aa Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2017 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRoutes

func InitRoutes()

func Start

func Start(host, port string)

func UsersCreate

func UsersCreate(ctx *gin.Context)

func UsersLogin

func UsersLogin(ctx *gin.Context)

Types

type Response

type Response struct {
}

func (Response) Error

func (r Response) Error(ctx *gin.Context, err interface{})

Error returns 200 OK response with json field "errors" with error descrioption. This function should be used to display validation or other expected errors. errors may be string or array of hashes.

func (Response) Forbidden

func (r Response) Forbidden(ctx *gin.Context)

Forbidden responses with 401 code, means user does not valid credentials to access handler.

func (Response) Panic

func (r Response) Panic(ctx *gin.Context, err error)

Panic responses with 503 error.

func (Response) Success

func (r Response) Success(ctx *gin.Context, body ...interface{})

Success responses with 200 code. Note: only first data argument will be passed to the response.

Jump to

Keyboard shortcuts

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