helpers

package
v0.0.0-...-40b02db Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindValidateStruct

func BindValidateStruct(ctx echo.Context, i interface{}) error

func GenerateJwtToken

func GenerateJwtToken(user models.User) (string, error)

func InArray

func InArray(v interface{}, in interface{}) (ok bool, i int)

func LOG

func LOG(title string, i interface{}, end bool)

func ReplaceSQL

func ReplaceSQL(old, searchPattern string) string

ReplaceSQL ...

func ResponseJSON

func ResponseJSON(success bool, code string, msg string, result interface{}) models.Response

func WeekRange

func WeekRange(year, week int) (start, end time.Time)

func WeekStart

func WeekStart(year, week int) time.Time

Types

type JwtClaims

type JwtClaims struct {
	ID       int64  `json:"id"`
	Email    string `json:"email"`
	Username string `json:"username"`
	jwt.StandardClaims
}

func ParseToken

func ParseToken(ctx echo.Context) (*JwtClaims, error)

Jump to

Keyboard shortcuts

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