wrapper

package
v0.0.0-...-64409e6 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPResponseJSON

func HTTPResponseJSON(w http.ResponseWriter, result *Result, code int, message string)

HTTPResponseJSON is a function

Types

type HTTPResult

type HTTPResult struct {
	Success bool         `json:"success" xml:"success"`
	Data    interface{}  `json:"data" xml:"data"`
	Message string       `json:"message" xml:"message"`
	Code    int          `json:"code" xml:"code"`
	Meta    *PartialMeta `json:"meta,omitempty" xml:"meta,omitempty"`
}

HTTPResult property

type PartialMeta

type PartialMeta struct {
	TotalDataOnAppear int `json:"totalDataOnPage" xml:"totalDataOnPage"`
	TotalDataAtAll    int `json:"totalData" xml:"totalData"`
	TotalPart         int `json:"totalPage" xml:"totalPage"`
	OnPart            int `json:"page" xml:"page"`
}

PartialMeta property

type Result

type Result struct {
	Err         error
	Data        interface{}
	Message     string
	PartialMeta *PartialMeta
}

Result property

func FindOneErrorResult

func FindOneErrorResult(results ...*Result) (errorResult *Result)

FindOneErrorResult will return one error of variadic, if the result is nil it means no error

Jump to

Keyboard shortcuts

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