https

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OK                = 200
	BadRequest        = 400
	UnAuthorized      = 401
	PermanentRequired = 402
	Forbidden         = 403
	NotFound          = 404
	ServerError       = 500
	BadGateway        = 502
)

Variables

This section is empty.

Functions

func Error

func Error(status int, str string) string

func GetParam

func GetParam(r *http.Request, key string) string

func GetParamInt

func GetParamInt(r *http.Request, key string) int

func ListResult

func ListResult(list any, total int) string

func ParseBody

func ParseBody(r *http.Request, v any) any

func PathVariable

func PathVariable(path, key string, r *http.Request) string

func Result

func Result(status int, message string) string

func Success

func Success(data any) string

Types

type ListRes

type ListRes struct {
	Status  int
	List    any
	Message string
	// contains filtered or unexported fields
}

func (ListRes) String

func (l ListRes) String() string

type Res

type Res struct {
	Status  int    `json:"status,omitempty"`
	Data    any    `json:"data,omitempty"`
	Message string `json:"message,omitempty"`
}

func (Res) String

func (r Res) String() string

Jump to

Keyboard shortcuts

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