util

package
v1.0.0-pre Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(c echo.Context, s interface{}) error

func BindBody

func BindBody(c echo.Context, s interface{}) error

func BindHeader

func BindHeader(c echo.Context, s interface{}) error

func BindPath

func BindPath(c echo.Context, s interface{}) error

func BindQuery

func BindQuery(c echo.Context, s interface{}) error

func CopySlice

func CopySlice[S, D any](src []S) []D

func Email

func Email(v, want interface{}) bool

func Fixed

func Fixed(v, want interface{}) bool

func GenToken

func GenToken(jcc JwtCustomClaims) (string, error)

func InitValidator

func InitValidator(e *echo.Echo)

func Max

func Max(v, want interface{}) bool

func Min

func Min(v, want interface{}) bool

func NewValidator

func NewValidator(e *echo.Echo) *validator

func ParseJsonFile

func ParseJsonFile(path string, dest any) error

func ParseJsonString

func ParseJsonString(sr string, dest any) error

func ParseYamlFile

func ParseYamlFile(path string, dest any) error

func ParseYamlString

func ParseYamlString(sr string, dest any) error

func Request

func Request(v, want interface{}) bool

func UUID

func UUID(v, want interface{}) bool

Types

type Copier

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

func GetCopier

func GetCopier(src, dest interface{}) *Copier

func NewCopier

func NewCopier(srcType, destType reflect.Type) *Copier

func (*Copier) Copy

func (c *Copier) Copy(dest, src interface{})

type JwtClaim

type JwtClaim struct {
	jwt.RegisteredClaims
	JwtCustomClaims
}

func ParseToken

func ParseToken(tokenStr string) (*JwtClaim, error)

func (*JwtClaim) Check

func (jc *JwtClaim) Check() bool

type JwtCustomClaims

type JwtCustomClaims struct {
	Name     string
	ExternId []byte
}

type Rule

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

type RuleFunc

type RuleFunc func(v, want interface{}) bool

type Validator

type Validator interface {
	Register(k string, fn RuleFunc)
	UnRegister(k string)
	SetupDefaultRules()
	Check(s interface{}) vErrs
}

func GetGlobalValidator

func GetGlobalValidator() Validator

Jump to

Keyboard shortcuts

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