api

package
v0.0.0-...-540b577 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RequestErrorHandler = func(c *gin.Context, err error) {
		writeResponse(c, http.StatusBadRequest, err.Error(), nil)
	}
	InternalErrorHandler = func(c *gin.Context) {
		writeResponse(c, http.StatusInternalServerError, "An Unexpected Error Occurred", nil)
	}
	SuccessHandler = func(c *gin.Context, data any) {
		writeResponse(c, http.StatusOK, "", data)
	}
)

Functions

This section is empty.

Types

type LoginReq

type LoginReq struct {
	Email    string `json:"email" form:"email" binding:"required"`
	Password string `json:"password" form:"password" binding:"required"`
}

type LoginResp

type LoginResp struct {
	Token string `json:"token" form:"token"`
}

type RegisterReq

type RegisterReq struct {
	Email    string `json:"email" form:"email" binding:"required"`
	Password string `json:"password" form:"password" binding:"required"`
}

type RegisterResp

type RegisterResp struct {
	Email    string `json:"email" form:"email" binding:"required"`
	Password string `json:"password" form:"password" binding:"required"`
}

type Response

type Response struct {
	Code    int    `json:"code"`
	Data    any    `json:"data"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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