response

package
v0.0.0-...-24b4de3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2018 License: GPL-2.0-only Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeJSON = 0
	TypeFile = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Change

type Change struct {
	Message  string `json:"message"`
	Affected int    `json:"affected"`
}

Change Response

type Core

type Core struct {
	Message string `json:"message"`
}

Core Response

type Message

type Message struct {
	StatusCode int
	Result     interface{}
	Type       int
}

Message is the return type of all handlers

func BadRequest

func BadRequest(message string) *Message

BadRequest sends response with status code 400

func Created

func Created(
	key string,
	results interface{}) *Message

Created sends response with status code 201

func File

func File(results string) *Message

File sends response with status code 200

func InternalServerError

func InternalServerError() *Message

InternalServerError sends response with status code 500

func MethodNotAllowed

func MethodNotAllowed() *Message

MethodNotAllowed sends response with status code 405

func NotFound

func NotFound(key string) *Message

NotFound sends response with status code 404

func Ok

func Ok(
	key string,
	length int,
	results interface{}) *Message

Ok sends response with status code 200

func Unauthorized

func Unauthorized(message string) *Message

Unauthorized sends response with status code 401

type Retrieve

type Retrieve struct {
	Message string      `json:"message"`
	Results interface{} `json:"results"`
}

Retrieve Response

Jump to

Keyboard shortcuts

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