api

package
v0.0.0-...-d0fd547 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorAuthForbidden = Error{
		Type:  "auth",
		Error: "forbidden",
	}

	ErrorNotAllowed = Error{
		Type:  "access",
		Error: "not allowed",
	}

	ErrorUrlInvalid = Error{
		Type:  "query",
		Field: "url",
		Error: "invalid",
	}

	ErrorHashInvalid = Error{
		Type:  "query",
		Field: "md5",
		Error: "invalid",
	}
)
View Source
var EmptyPayload interface{}

Functions

This section is empty.

Types

type Error

type Error struct {
	Type  string `json:"type"`
	Field string `json:"field,omitempty"`
	Error string `json:"error"`
}

type Response

type Response struct {
	Success   bool        `json:"success"`
	Errors    []Error     `json:"errors,omitempty"`
	Payload   interface{} `json:"payload,omitempty"`
	Timestamp int64       `json:"ts,omitempty"`
}

func ErrorResponse

func ErrorResponse(errors []Error) *Response

func SuccessResponse

func SuccessResponse(payload interface{}) *Response

Jump to

Keyboard shortcuts

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