response

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2022 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OKCode :
	OKCode int = 200
	// FailedCode :
	FailedCode int = 210
	// AuthFailedCode :
	AuthFailedCode int = 401

	// Status codes:
	// StatusOK :
	StatusOK StatusCode = 200

	// StatusBadRequest
	StatusBadRequest       StatusCode = 400
	StatusUnauthorized     StatusCode = 401
	StatusForbidden        StatusCode = 403
	StatusNotFound         StatusCode = 404
	StatusMethodNotAllowed StatusCode = 405
	StatusRequestTimeout   StatusCode = 408

	StatusInternalServerError StatusCode = 500
	StatusNotImplemented      StatusCode = 501
	StatusBadGateway          StatusCode = 502
	StatusServiceUnavailable  StatusCode = 503
	StatusGatewayTimeout      StatusCode = 504
)

response code:

Variables

This section is empty.

Functions

This section is empty.

Types

type FailedWithReason

type FailedWithReason struct {
	Code StatusCode        `json:"code"`
	Msg  string            `json:"msg"`
	Data map[string]string `json:"data"` // failed reason, one reason one map item
}

FailedWithReason :

type ResponseIntMap

type ResponseIntMap struct {
	Code StatusCode  `json:"code"`
	Msg  string      `json:"msg"`
	Data map[int]int `json:"data"`
}

ResponseIntMap :

type ResponseInterface

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

common response structs:

type StatusCode

type StatusCode int

StatusCode : enum

type Success

type Success struct {
	Code StatusCode `json:"code"`
	Msg  string     `json:"msg"`
}

Success :

type SuccessArray

type SuccessArray struct {
	Code StatusCode `json:"code"`
	Msg  string     `json:"msg"`
	Data []string   `json:"data"`
}

SuccessArray :

type SuccessInt

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

SuccessUint :

type SuccessInt64

type SuccessInt64 struct {
	Code StatusCode `json:"code"`
	Msg  string     `json:"msg"`
	Data int64      `json:"data"`
}

SuccessUint64 :

type SuccessInt64Array

type SuccessInt64Array struct {
	Code StatusCode `json:"code"`
	Msg  string     `json:"msg"`
	Data []int64    `json:"data"`
}

SuccessArray :

type SuccessMap

type SuccessMap struct {
	Code StatusCode        `json:"code"`
	Msg  string            `json:"msg"`
	Data map[string]string `json:"data"`
}

SuccessMap :

type SuccessMapArray

type SuccessMapArray struct {
	Code StatusCode          `json:"code"`
	Msg  string              `json:"msg"`
	Data []map[string]string `json:"data"`
}

SuccessMapArray :

type SuccessMapInt

type SuccessMapInt struct {
	Code StatusCode     `json:"code"`
	Msg  string         `json:"msg"`
	Data map[string]int `json:"data"`
}

SuccessMapInt :

type SuccessMapInt64

type SuccessMapInt64 struct {
	Code StatusCode       `json:"code"`
	Msg  string           `json:"msg"`
	Data map[string]int64 `json:"data"`
}

SuccessMapInt :

type VueGetUserInfoData

type VueGetUserInfoData struct {
	Name         string   `json:"name"`
	Roles        []string `json:"roles"`
	Introduction string   `json:"introduction"`
	Avatar       string   `json:"avatar"`
}

type VueGetUserInfoResponse

type VueGetUserInfoResponse struct {
	Code StatusCode          `json:"code"`
	Data *VueGetUserInfoData `json:"data"`
}

type VueLoginFailedResponse

type VueLoginFailedResponse struct {
	Code StatusCode `json:"code"`
	Msg  string     `json:"message"`
}

type VueLoginResponse

type VueLoginResponse struct {
	Code StatusCode            `json:"code"`
	Data *VueLoginResponseData `json:"data"`
}

type VueLoginResponseData

type VueLoginResponseData struct {
	Token string `json:"token"`
}

type VueLogout

type VueLogout struct {
	Code int64  `json:"code"`
	Data string `json:"data"`
}

Jump to

Keyboard shortcuts

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