httputils

package module
v0.0.0-...-d6422a7 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CookieCertificateKey = "WarehouseSessionID"
)

Variables

View Source
var ResponseMessages map[ResponseCode]string = map[ResponseCode]string{
	RespSuccess:          "success",
	RespSystemFailed:     "system failed",
	RespUserMismatch:     "login failed, id mismatch",
	RespPasswordMismatch: "login failed, password mismatch",
	RespUserExpired:      "login failed, user expired",
	RespUserLocked:       "login failed, user locked",
	RespPasswordExpired:  "login failed, password expired",
}

Functions

func NewHandlerResponse

func NewHandlerResponse(status ResponseCode, data string) gin.H

Types

type HandlerResponse

type HandlerResponse interface {
	Response() gin.H
}

func NewLoginResponse

func NewLoginResponse(status ResponseCode, session sessions.Session, cert model.Certificate, data string) HandlerResponse

type LoginParam

type LoginParam struct {
	ID       string `json:"id" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type LoginResponse

type LoginResponse struct {
	// contains filtered or unexported fields
}

func (*LoginResponse) Response

func (r *LoginResponse) Response() gin.H

type ResponseCode

type ResponseCode int
const (
	RespSuccess ResponseCode = iota
	RespSystemFailed
	RespUserMismatch
	RespPasswordMismatch
	RespUserExpired
	RespUserLocked
	RespPasswordExpired
)

Jump to

Keyboard shortcuts

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