helper

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsPtr

func AsPtr[T interface{}](b T) *T

func CamelToSnake

func CamelToSnake(s string) string

CamelToSnake converts a camel case string to snake case.

func ConvertSliceToReference

func ConvertSliceToReference[T interface{}](slice []T) []*T

func ErrorPanic

func ErrorPanic(err error)

func GetSortString

func GetSortString(input string) string

func JsonRawMessageToJson

func JsonRawMessageToJson(message json.RawMessage) (map[string]interface{}, error)

func ParamAsUUId

func ParamAsUUId(ctx *gin.Context, key string) (uuid.UUID, error)

func QueryAsUUId

func QueryAsUUId(ctx *gin.Context, key string) *uuid.UUID

func ReadJsonAsType

func ReadJsonAsType[T interface{}](rc io.ReadCloser) ([]T, error)

func StringToBool

func StringToBool(input string) (*bool, error)

func StringToDate

func StringToDate(input string) (*time.Time, error)

func StringToDateOnly

func StringToDateOnly(input string) (*types.DateOnly, error)

func StringToFloat64

func StringToFloat64(input string) (*float64, error)

func StringToInt64

func StringToInt64(input string) (*int64, error)

func StringToTimeOnly

func StringToTimeOnly(input string) (*types.TimeOnly, error)

Types

type GroupedError

type GroupedError struct {
	Errors []gojsonschema.ResultError
}

func (*GroupedError) Error

func (e *GroupedError) Error() string

func (*GroupedError) GetErrors

func (e *GroupedError) GetErrors() []gojsonschema.ResultError

Jump to

Keyboard shortcuts

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