utils

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteToObj

func ByteToObj(buf []byte, out interface{}) (err error)

func Decode

func Decode(reader io.Reader, obj interface{}) error

func MapToObj

func MapToObj(maps map[string]interface{}, out interface{}) error

func Marshal

func Marshal(in interface{}) (str string, err error)

func MustObjToByte

func MustObjToByte(in interface{}) []byte

MustObjToByte not json

func ObjToByte

func ObjToByte(in interface{}) (buf []byte, err error)

func ObjToJsonStr

func ObjToJsonStr(obj interface{}) (str string)

func ObjToMap

func ObjToMap(in interface{}) map[string]interface{}

func PrintPanicInfo

func PrintPanicInfo(msg string)

func ProcessErr

func ProcessErr(u interface{}, err error) string

ProcessErr processes validation errors and returns an error message. It handles custom rules and error messages for the go-validator parameter validator.

func Struct

func Struct(s interface{}) error

func TraceElapsed

func TraceElapsed(start time.Time)

func TraceElapsedByName

func TraceElapsedByName(start time.Time, traceName string)

func TraceHttpReq

func TraceHttpReq(ctx *fasthttp.RequestCtx, start time.Time)

func TraceHttpReqByCtx added in v0.0.3

func TraceHttpReqByCtx(ctx *fasthttp.RequestCtx) func()

func Unmarshal

func Unmarshal(in string, out interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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