Documentation ¶
Index ¶
- func BoolStringToInt(s string) int
- func BoolToInt(b bool) int
- func IntToBool(i int) bool
- func Map[T any](item T) (m map[string]interface{}, err error)
- func Marshal[T any](item T) (content []byte, err error)
- func Marshals[T any](items []T) (content []byte, err error)
- func String[T any](item T) (s string)
- func Stringify(r *http.Response) (s string, b []byte)
- func Unmap[T any](m map[string]interface{}) (item T, err error)
- func Unmarshal[T any](content []byte) (item T, err error)
- func Unmarshals[T any](content []byte) (items []T, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolStringToInt ¶
BoolStringToInt helper to deal with get param bools that convert over to 1 | 0 for the db
func BoolToInt ¶
IntToBool helper used with sql conversion as sqlite has no boolean type, they are stored as 1 (true) or 0
func IntToBool ¶
IntToBool helper used with sql conversion as sqlite has no boolean type, they are stored as 1 (true) or 0, this maps them back to a bool
func Marshals ¶
Marshals is also a wraper around MarshalIndent, used to keep naming convention of unmarshaling versions
func Stringify ¶
Stringify returns the body content of a http.Response as both a string and []byte. Very helpful for debugging, testing and converting back and forth from the api.
func Unmarshals ¶
Unmarshals wrapper for mutliple types for shorthand and deals with error logging
Types ¶
This section is empty.