rest

package
v2.0.0-...-8f2ac71 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BadGateway = HttpStatus{502, "Bad Gateway"}
View Source
var BadRequest = HttpStatus{400, "Bad Request"}
View Source
var Forbidden = HttpStatus{403, "Forbidden"}
View Source
var NotFound = HttpStatus{404, "Not Found"}
View Source
var OK = HttpStatus{200, "OK"}
View Source
var ServerError = HttpStatus{500, "Internal Server Error"}
View Source
var Unauthorized = HttpStatus{401, "Unauthorized"}

Functions

func GetReason

func GetReason(value int) string

Types

type HttpStatus

type HttpStatus struct {
	Value        int
	ReasonPhrase string
}

func GetHttpStatus

func GetHttpStatus(value int) (status *HttpStatus)

type Pageable

type Pageable struct {
	PageNumber int   `json:"pageNumber"`
	PageSize   int   `json:"pageSize"`
	TotalItems int64 `json:"totalItems"`
	TotalPages int64 `json:"totalPages"`
}

Pageable general page data

func NewPageable

func NewPageable(pageNumber int, pageSize int, totalItems int64) (page Pageable)

NewPageable return new Pageable info

type Result

type Result struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

Result HTTP request result

func NewQueryPage

func NewQueryPage(items []map[string]interface{}, page, size int, total int64) Result

NewQueryPage create new page result

func NewResult

func NewResult(data interface{}, c int, msg string) Result

NewResult create new result

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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