internal

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PackageVersion = "1.0.0"
)
View Source
const Undef = "undef"

Variables

View Source
var (
	ErrInvalidEnumValue  = errors.New("invalid enum value")
	ErrInvalidJSONString = errors.New("invalid JSON string")
)
View Source
var (
	ErrInvalidType = errors.New("invalid type")
)

Functions

func CloseBody

func CloseBody(body io.Closer)

func CoerceBool

func CoerceBool(into *bool, v interface{}) error

func CoerceFloat

func CoerceFloat(into *float64, v interface{}) error

func CoerceInt

func CoerceInt(into *int, v interface{}) error

func CoerceInt64

func CoerceInt64(into *int64, v interface{}) error

func CoerceStringArray

func CoerceStringArray(into *[]string, v interface{}) error

func CoerceUInt32

func CoerceUInt32(into *uint32, v interface{}) error

func UnwrapJSONString

func UnwrapJSONString(b []byte) (string, error)

func WrapEnumTypeJSON

func WrapEnumTypeJSON(s fmt.Stringer) ([]byte, error)

Types

type CoercedBool

type CoercedBool struct{ Value bool }

func (*CoercedBool) UnmarshalJSON

func (c *CoercedBool) UnmarshalJSON(data []byte) error

type CoercedFloat

type CoercedFloat struct{ Value float64 }

func (*CoercedFloat) UnmarshalJSON

func (c *CoercedFloat) UnmarshalJSON(data []byte) error

type CoercedInt

type CoercedInt struct{ Value int }

func (*CoercedInt) UnmarshalJSON

func (c *CoercedInt) UnmarshalJSON(data []byte) error

type CoercedInt64

type CoercedInt64 struct{ Value int64 }

func (*CoercedInt64) UnmarshalJSON

func (c *CoercedInt64) UnmarshalJSON(data []byte) error

type CoercedStringArray

type CoercedStringArray struct{ Value []string }

func (*CoercedStringArray) UnmarshalJSON

func (c *CoercedStringArray) UnmarshalJSON(data []byte) error

type CoercedUInt32

type CoercedUInt32 struct{ Value uint32 }

func (*CoercedUInt32) UnmarshalJSON

func (c *CoercedUInt32) UnmarshalJSON(data []byte) error

type XEnum

type XEnum[T XEnumKind[T]] struct {
	Kind   T
	XValue string
}

func (*XEnum[T]) MarshalJSON

func (f *XEnum[T]) MarshalJSON() ([]byte, error)

func (*XEnum[T]) String

func (f *XEnum[T]) String() string

func (*XEnum[T]) UnmarshalJSON

func (f *XEnum[T]) UnmarshalJSON(b []byte) error

type XEnumKind

type XEnumKind[T ~int] interface {
	~int
	fmt.Stringer
	Parse(string) (T, error)
}

Jump to

Keyboard shortcuts

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