utils

package
v0.0.0-...-6a020d3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindJSON

func BindJSON(c *gin.Context, obj any) error

BindJSON is a wrapper for gin.Context.ShouldBindJSON with enhanced error handling

func ValidateUrl

func ValidateUrl(u string) (string, error)

validateUrl checks if the given string is a valid complete URL, and either returns a absolute url, or an error. If the input url is not an absolute url, but just a fully qualified domain, http:// will be prepended.

Types

type NullTime

type NullTime struct {
	sql.NullTime
}

NullTime is an alias for sql.NullTime with custom JSON unmarshaling

func (*NullTime) UnmarshalJSON

func (nt *NullTime) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals a JSON string into NullTime

Jump to

Keyboard shortcuts

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