fuzzy

package module
v0.0.0-...-31ea371 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 6 Imported by: 0

README

fuzzy

Decode any JSON value to Go type

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool bool

Bool can be used to decode any JSON value to bool. Empty strings as well as "false" and "0" evaluate to false, all other strings are true. Numbers equal to 0 will evaluate to false, all other numbers are true.

func (Bool) MarshalJSON

func (fb Bool) MarshalJSON() ([]byte, error)

MarshalJSON method for Bool

func (*Bool) UnmarshalJSON

func (fb *Bool) UnmarshalJSON(bArr []byte) (err error)

UnmarshalJSON method for Bool

type Float

type Float float64

Float can be used to decode any JSON value to int64. Strings that are not valid representation of a number will error. Boolean values will error

func (Float) MarshalJSON

func (fi Float) MarshalJSON() ([]byte, error)

MarshalJSON method for Float

func (*Float) UnmarshalJSON

func (fi *Float) UnmarshalJSON(bArr []byte) (err error)

UnmarshalJSON method for Float

type Int

type Int int64

Int can be used to decode any JSON value to int64. Strings that are not valid representation of a number will error. Boolean values will error

func (Int) MarshalJSON

func (fi Int) MarshalJSON() ([]byte, error)

MarshalJSON method for Int

func (*Int) UnmarshalJSON

func (fi *Int) UnmarshalJSON(bArr []byte) (err error)

UnmarshalJSON method for Int

type NullBool

type NullBool null.Bool

NullBool can be used to decode any JSON value to bool. Empty strings as well as "false" and "0" evaluate to false, all other strings are true. Numbers equal to 0 will evaluate to false, all other numbers are true.

func (NullBool) MarshalJSON

func (fb NullBool) MarshalJSON() ([]byte, error)

MarshalJSON method for Bool

func (*NullBool) UnmarshalJSON

func (fb *NullBool) UnmarshalJSON(bArr []byte) (err error)

UnmarshalJSON method for Bool

type NullFloat

type NullFloat null.Float

NullFloat can be used to decode any JSON value to int64. Strings that are not valid representation of a number will error. Boolean values will error

func (NullFloat) MarshalJSON

func (fi NullFloat) MarshalJSON() ([]byte, error)

MarshalJSON method for Float

func (*NullFloat) UnmarshalJSON

func (fi *NullFloat) UnmarshalJSON(bArr []byte) (err error)

UnmarshalJSON method for Float

type NullInt

type NullInt null.Int

NullInt can be used to decode any JSON value to int64. Strings that are not valid representation of a number will error. Boolean values will error

func (NullInt) MarshalJSON

func (fi NullInt) MarshalJSON() ([]byte, error)

MarshalJSON method for Int

func (*NullInt) UnmarshalJSON

func (fi *NullInt) UnmarshalJSON(bArr []byte) (err error)

UnmarshalJSON method for Int

type NullString

type NullString null.String

NullString can be used to decode any JSON value to string

func (NullString) MarshalJSON

func (fs NullString) MarshalJSON() ([]byte, error)

MarshalJSON method with value receiver for String Method must not have a pointer receiver! See https://stackoverflow.com/a/21394657/639133

func (*NullString) UnmarshalJSON

func (fs *NullString) UnmarshalJSON(bArr []byte) (err error)

UnmarshalJSON for String

type String

type String string

String can be used to decode any JSON value to string

func (String) MarshalJSON

func (fs String) MarshalJSON() ([]byte, error)

MarshalJSON method with value receiver for String Method must not have a pointer receiver! See https://stackoverflow.com/a/21394657/639133

func (*String) UnmarshalJSON

func (fs *String) UnmarshalJSON(bArr []byte) (err error)

UnmarshalJSON for String

Jump to

Keyboard shortcuts

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