convert

package
v1.0.0-sql.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolStringToInt

func BoolStringToInt(s string) int

func BoolToInt

func BoolToInt(b bool) int

func IntToBool

func IntToBool(i int) bool

func Map

func Map[T any](item T) (m map[string]interface{}, err error)

func Marshal

func Marshal[T any](item T) (content []byte, err error)

func Printify

func Printify[T any](item T) (s string)

func Stringify

func Stringify(r *http.Response) (s string, b []byte)

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 Unmap

func Unmap[T any](m map[string]interface{}) (item T, err error)

Unmap uses json marshaling to convert from a map back to a struct.

func Unmarshal

func Unmarshal[T any](content []byte, i T) (item T, err error)

func Unmarshals

func Unmarshals[T any](content []byte, i []T) (items []T, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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