api

package
v0.0.0-...-6e811ef Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Login

func Login(ctx *gin.Context)

func Ping

func Ping(ctx *gin.Context)

func Register

func Register(ctx *gin.Context)

Types

type ApiCode

type ApiCode int
const (
	Success     ApiCode = 0
	BodyBindErr ApiCode = 10001
	ParamErr    ApiCode = 10002
	RegisterErr ApiCode = 10003
	LoginErr    ApiCode = 10004
	LogoutErr   ApiCode = 10005
	GetErr      ApiCode = 10006
	UpdateErr   ApiCode = 10007
	HashErr     ApiCode = 10008
	Unknown     ApiCode = 20000
)

type ApiResponse

type ApiResponse struct {
	Code    ApiCode
	Data    interface{}
	Message string
	Ctx     *gin.Context `json:"-"`
}

func (*ApiResponse) Error

func (resp *ApiResponse) Error(code ApiCode, message string)

func (*ApiResponse) Success

func (resp *ApiResponse) Success()

func (*ApiResponse) WithData

func (resp *ApiResponse) WithData(data interface{})

type DebugType

type DebugType int

Jump to

Keyboard shortcuts

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