tests

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalBasicTypesAsJSON

func MarshalBasicTypesAsJSON(s *BasicTypes) ([]byte, error)

func MarshalIssue24StructAsJSON added in v0.0.3

func MarshalIssue24StructAsJSON(s *Issue24Struct) ([]byte, error)

func MarshalMapTypesAsJSON

func MarshalMapTypesAsJSON(s *MapTypes) ([]byte, error)

func MarshalNestedTypesAsJSON

func MarshalNestedTypesAsJSON(s *NestedTypes) ([]byte, error)

func MarshalOmitemptyPointerStructAsJSON

func MarshalOmitemptyPointerStructAsJSON(s *OmitemptyPointerStruct) ([]byte, error)

func MarshalOmitemptyStructAsJSON

func MarshalOmitemptyStructAsJSON(s *OmitemptyStruct) ([]byte, error)

func MarshalPointerTypesAsJSON

func MarshalPointerTypesAsJSON(s *PointerTypes) ([]byte, error)

func MarshalSliceTypesAsJSON

func MarshalSliceTypesAsJSON(s *SliceTypes) ([]byte, error)

func MarshalStringArrayAsJSON added in v0.0.2

func MarshalStringArrayAsJSON(st []string) ([]byte, error)

func MarshalStringToStringMapAsJSON added in v0.0.2

func MarshalStringToStringMapAsJSON(mt map[string]string) ([]byte, error)

Types

type BasicTypes

type BasicTypes struct {
	BoolValue    bool    `json:"bool_value"`
	IntValue     int     `json:"int_value"`
	Int8Value    int8    `json:"int8_value"`
	Int16Value   int16   `json:"int16_value"`
	Int32Value   int32   `json:"int32_value"`
	Int64Value   int64   `json:"int64_value"`
	UintValue    uint    `json:"uint_value"`
	Uint8Value   uint8   `json:"uint8_value"`
	Uint16Value  uint16  `json:"uint16_value"`
	Uint32Value  uint32  `json:"uint32_value"`
	Uint64Value  uint64  `json:"uint64_value"`
	Float32Value float32 `json:"float32_value"`
	Float64Value float64 `json:"float64_value"`
	StringValue  string  `json:"string_value"`
}

type Issue24Struct added in v0.0.3

type Issue24Struct struct {
	Foo string `json:"foo"`
	Bar string
}

see: https://github.com/moznion/go-json-ice/issues/24

type MapTypes

type MapTypes struct {
	Map             map[string]string            `json:"map"`
	MapSlice        []map[string]string          `json:"map_slice"`
	NestedMap       map[string]map[string]string `json:"nested_map"`
	IntKeyMap       map[int]string               `json:"int_key_map"`
	SliceValueMap   map[string][]string          `json:"slice_value_map"`
	PointerValueMap map[string]*string           `json:"pointer_value_map"`
	NullMap         map[string]string            `json:"null_map"`
}

type NestedTypes

type NestedTypes struct {
	Field1         OmitemptyStruct  `json:"field1"`
	Field2         *OmitemptyStruct `json:"field2"`
	OmittableField *OmitemptyStruct `json:"omittable_field,omitempty"`
}

type OmitemptyPointerStruct

type OmitemptyPointerStruct struct {
	EmptyBool      *bool             `json:"empty_bool,omitempty"`
	EmptyInt       *int              `json:"empty_int,omitempty"`
	EmptyUint      *uint             `json:"empty_uint,omitempty"`
	EmptyFloat     *float32          `json:"empty_float,omitempty"`
	EmptyString    *string           `json:"empty_string,omitempty"`
	EmptySlice     []string          `json:"empty_slice,omitempty"`
	EmptyMap       map[string]string `json:"empty_map,omitempty"`
	NotEmptyString *string           `json:"not_empty_string"`
}

type OmitemptyStruct

type OmitemptyStruct struct {
	EmptyBool      bool    `json:"empty_bool,omitempty"`
	EmptyInt       int     `json:"empty_int,omitempty"`
	EmptyUint      uint    `json:"empty_uint,omitempty"`
	EmptyFloat     float32 `json:"empty_float,omitempty"`
	EmptyString    string  `json:"empty_string,omitempty"`
	NotEmptyString string  `json:"not_empty_string"`
}

func (*OmitemptyStruct) MarshalJSON

func (o *OmitemptyStruct) MarshalJSON() ([]byte, error)

type PointerTypes

type PointerTypes struct {
	BoolValue    *bool    `json:"bool_value"`
	IntValue     *int     `json:"int_value"`
	Int8Value    *int8    `json:"int8_value"`
	Int16Value   *int16   `json:"int16_value"`
	Int32Value   *int32   `json:"int32_value"`
	Int64Value   *int64   `json:"int64_value"`
	UintValue    *uint    `json:"uint_value"`
	Uint8Value   *uint8   `json:"uint8_value"`
	Uint16Value  *uint16  `json:"uint16_value"`
	Uint32Value  *uint32  `json:"uint32_value"`
	Uint64Value  *uint64  `json:"uint64_value"`
	Float32Value *float32 `json:"float32_value"`
	Float64Value *float64 `json:"float64_value"`
	StringValue  *string  `json:"string_value"`
}

type SliceTypes

type SliceTypes struct {
	StringSlice        []string  `json:"string_slice"`
	StringPointerSlice []*string `json:"string_pointer_slice"`
	EmptySlice         []string  `json:"empty_slice"`
	NullSlice          []string  `json:"null_slice"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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