...

Package tests

import "github.com/mailru/easyjson/tests"
Overview
Index

Overview ▾

Index ▾

Variables
type Arrays
type CustomMapKeyType
type DeepNest
type DeepNestOptional
type DisallowUnknown
type EmbeddedInnerType
type EmbeddedInnerType2
type EmbeddedStruct
type EmbeddedType
type EncodingFlagsTestMap
type EncodingFlagsTestSlice
type ErrorBoolSlice
type ErrorIntMap
type ErrorIntSlice
type ErrorNestedStruct
type ErrorStruct
type ErrorUintSlice
type EscIntStruct
type EscStringStruct
type ExcludedField
type GenDeclared1
type GenDeclaredWithComment
type IntArray
type IntArrayStruct
type IntKeyedMapStruct
type Intern
type Ints
type KeyWithEncodingMarshaler
    func (f KeyWithEncodingMarshaler) MarshalText() (text []byte, err error)
    func (f *KeyWithEncodingMarshaler) UnmarshalText(text []byte) error
type KeyWithEncodingMarshalers
type MapInt32String
type MapInt64String
type MapIntString
type MapMyIntString
type MapStringString
type MapUint32String
type MapUint64String
type MapUintString
type MapUintptrString
type Maps
type MembersEscaped
type MembersUnescaped
type MyInt
type MyString
type MyUInt8
type MyUInt8Array
type MyUInt8Slice
type NamedBool
type NamedFloat32
type NamedFloat64
type NamedInt
type NamedInt16
type NamedInt32
type NamedInt64
type NamedInt8
type NamedMap
type NamedPrimitiveTypes
type NamedSlice
type NamedStrPtr
type NamedString
type NamedType
type NamedUint
type NamedUint16
type NamedUint32
type NamedUint64
type NamedUint8
type NestedEasyMarshaler
    func (i *NestedEasyMarshaler) MarshalEasyJSON(w *jwriter.Writer)
type NestedInterfaces
type NestedMarshaler
type NoIntern
type NocopyStruct
type OmitEmpty
type OmitEmptyDefault
type Opts
type PrimitiveTypes
type Raw
type RequiredOptionalMap
type RequiredOptionalStruct
type Slices
type SnakeStruct
type StdMarshaler
type Str
type Struct
type Struct1
type Struct2
type StructWithInterface
type StructWithMarshaler
    func (s *StructWithMarshaler) MarshalEasyJSON(w *jwriter.Writer)
    func (s *StructWithMarshaler) UnmarshalEasyJSON(w *jlexer.Lexer)
type StructWithUnknownsProxy
type StructWithUnknownsProxyWithOmitempty
type Structs
type SubP
type SubStruct
type SubStructAlias
type TypeDeclared
type TypeNotDeclared
type TypeNotSkipped
type TypeSkipped
type UserMarshaler

Package files

custom_map_key_type.go data.go disallow_unknown.go embedded_type.go errors.go escaping.go html.go intern.go key_marshaler_map.go members_escaped.go members_unescaped.go named_type.go nested_easy.go nested_marshaler.go nocopy.go nothing.go omitempty.go reference_to_pointer.go snake.go type_declaration.go type_declaration_skip.go unknown_fields.go

Variables

var IntsString = `[1,2,3,4,5]`
var IntsValue = Ints{1, 2, 3, 4, 5}

type Arrays

type Arrays struct {
    ByteArray      [3]byte
    EmptyByteArray [0]byte
    IntArray       [5]int
    EmptyIntArray  [0]int
}

type CustomMapKeyType

type CustomMapKeyType struct {
    Map map[customKeyType]int
}

type DeepNest

type DeepNest struct {
    SliceMap         map[Str][]Str
    SliceMap1        map[Str][]Str
    SliceMap2        map[Str][]Str
    NamedSliceMap    map[Str]NamedSlice
    NamedMapMap      map[Str]NamedMap
    MapSlice         []map[Str]Str
    NamedSliceSlice  []NamedSlice
    NamedMapSlice    []NamedMap
    NamedStringSlice []NamedString
}

type DeepNestOptional

type DeepNestOptional struct {
    MapSlice []map[Str]Str `json:",omitempty"`
}

type DisallowUnknown

type DisallowUnknown struct {
    FieldOne string `json:"field_one"`
}

type EmbeddedInnerType

type EmbeddedInnerType struct {
    Field1 int
}

type EmbeddedInnerType2

type EmbeddedInnerType2 struct {
    Field3 int
}

type EmbeddedStruct

type EmbeddedStruct struct {
    Field1 int    `json:"f1"`
    Field2 string `json:"f2"`
}

type EmbeddedType

type EmbeddedType struct {
    EmbeddedInnerType
    Inner struct {
        EmbeddedInnerType
    }
    Field2             int
    EmbeddedInnerType2 `json:"named"`
}

type EncodingFlagsTestMap

type EncodingFlagsTestMap struct {
    F map[string]string
}

type EncodingFlagsTestSlice

type EncodingFlagsTestSlice struct {
    F []string
}

type ErrorBoolSlice

type ErrorBoolSlice []bool

type ErrorIntMap

type ErrorIntMap map[uint32]string

type ErrorIntSlice

type ErrorIntSlice []int

type ErrorNestedStruct

type ErrorNestedStruct struct {
    ErrorStruct ErrorStruct `json:"error_struct"`
    Int         int         `json:"int"`
}

type ErrorStruct

type ErrorStruct struct {
    Int      int    `json:"int"`
    String   string `json:"string"`
    Slice    []int  `json:"slice"`
    IntSlice []int  `json:"int_slice"`
}

type ErrorUintSlice

type ErrorUintSlice []uint

type EscIntStruct

type EscIntStruct struct {
    A int `json:"a,string"`
}

type EscStringStruct

type EscStringStruct struct {
    A string `json:"a"`
}

type ExcludedField

type ExcludedField struct {
    Process       bool `json:"process"`
    DoNotProcess  bool `json:"-"`
    DoNotProcess1 bool `json:"-"`
}

type GenDeclared1

type GenDeclared1 struct {
    Value string
}

type GenDeclaredWithComment

A gen declared easyjson struct with a comment

type GenDeclaredWithComment struct {
    Value string
}

type IntArray

type IntArray [2]int

type IntArrayStruct

type IntArrayStruct struct {
    Pointer *IntArray `json:"pointer"`
    Value   IntArray  `json:"value"`
}

type IntKeyedMapStruct

type IntKeyedMapStruct struct {
    Foo MapMyIntString            `json:"foo"`
    Bar map[int16]MapUint32String `json:"bar"`
}

type Intern

type Intern struct {
    Field string `json:"field,intern"`
}

type Ints

type Ints []int

type KeyWithEncodingMarshaler

type KeyWithEncodingMarshaler int

func (KeyWithEncodingMarshaler) MarshalText

func (f KeyWithEncodingMarshaler) MarshalText() (text []byte, err error)

func (*KeyWithEncodingMarshaler) UnmarshalText

func (f *KeyWithEncodingMarshaler) UnmarshalText(text []byte) error

type KeyWithEncodingMarshalers

type KeyWithEncodingMarshalers map[KeyWithEncodingMarshaler]string

type MapInt32String

type MapInt32String map[int32]string

type MapInt64String

type MapInt64String map[int64]string

type MapIntString

type MapIntString map[int]string

type MapMyIntString

type MapMyIntString map[MyInt]string

type MapStringString

type MapStringString map[string]string

type MapUint32String

type MapUint32String map[uint32]string

type MapUint64String

type MapUint64String map[uint64]string

type MapUintString

type MapUintString map[uint]string

type MapUintptrString

type MapUintptrString map[uintptr]string

type Maps

type Maps struct {
    Map          map[string]string
    InterfaceMap map[string]interface{}
    NilMap       map[string]string

    CustomMap map[Str]Str
}

type MembersEscaped

type MembersEscaped struct {
    A string `json:"漢語"`
}

type MembersUnescaped

type MembersUnescaped struct {
    A string `json:"漢語"`
}

type MyInt

type MyInt int

type MyString

type MyString string

type MyUInt8

type MyUInt8 uint8

type MyUInt8Array

type MyUInt8Array [2]MyUInt8

type MyUInt8Slice

type MyUInt8Slice []MyUInt8

type NamedBool

type NamedBool bool

type NamedFloat32

type NamedFloat32 float32

type NamedFloat64

type NamedFloat64 float64

type NamedInt

type NamedInt int

type NamedInt16

type NamedInt16 int16

type NamedInt32

type NamedInt32 int32

type NamedInt64

type NamedInt64 int64

type NamedInt8

type NamedInt8 int8

type NamedMap

type NamedMap map[Str]Str

type NamedPrimitiveTypes

type NamedPrimitiveTypes struct {
    String NamedString
    Bool   NamedBool

    Int   NamedInt
    Int8  NamedInt8
    Int16 NamedInt16
    Int32 NamedInt32
    Int64 NamedInt64

    Uint   NamedUint
    Uint8  NamedUint8
    Uint16 NamedUint16
    Uint32 NamedUint32
    Uint64 NamedUint64

    Float32 NamedFloat32
    Float64 NamedFloat64

    Ptr    NamedStrPtr
    PtrNil NamedStrPtr
}

type NamedSlice

type NamedSlice []Str

type NamedStrPtr

type NamedStrPtr *string

type NamedString

type NamedString string

type NamedType

type NamedType struct {
    Inner struct {
        // easyjson is mistakenly naming the type of this field 'tests.MyString' in the generated output
        // something about a named type inside an anonmymous type is triggering this bug
        Field  MyString `tag:"value"`
        Field2 int      "tag:\"value with ` in it\""
    }
}

type NamedUint

type NamedUint uint

type NamedUint16

type NamedUint16 uint16

type NamedUint32

type NamedUint32 uint32

type NamedUint64

type NamedUint64 uint64

type NamedUint8

type NamedUint8 uint8

type NestedEasyMarshaler

type NestedEasyMarshaler struct {
    EasilyMarshaled bool
}

func (*NestedEasyMarshaler) MarshalEasyJSON

func (i *NestedEasyMarshaler) MarshalEasyJSON(w *jwriter.Writer)

type NestedInterfaces

type NestedInterfaces struct {
    Value interface{}
    Slice []interface{}
    Map   map[string]interface{}
}

type NestedMarshaler

type NestedMarshaler struct {
    Value  easyjson.MarshalerUnmarshaler
    Value2 int
}

type NoIntern

type NoIntern struct {
    Field string `json:"field"`
}

type NocopyStruct

type NocopyStruct struct {
    A string `json:"a"`
    B string `json:"b,nocopy"`
}

type OmitEmpty

type OmitEmpty struct {
    StrE, StrNE string  `json:",omitempty"`
    PtrE, PtrNE *string `json:",omitempty"`

    IntNE int `json:"intField,omitempty"`
    IntE  int `json:",omitempty"`

    // NOTE: omitempty has no effect on non-pointer struct fields.
    SubE, SubNE   SubStruct  `json:",omitempty"`
    SubPE, SubPNE *SubStruct `json:",omitempty"`
}

type OmitEmptyDefault

type OmitEmptyDefault struct {
    Field string
    Str   string
    Str1  string `json:"s,!omitempty"`
    Str2  string `json:",!omitempty"`
}

type Opts

type Opts struct {
    StrNull      opt.String
    StrEmpty     opt.String
    Str          opt.String
    StrOmitempty opt.String `json:",omitempty"`

    IntNull opt.Int
    IntZero opt.Int
    Int     opt.Int
}

type PrimitiveTypes

type PrimitiveTypes struct {
    String string
    Bool   bool

    Int   int
    Int8  int8
    Int16 int16
    Int32 int32
    Int64 int64

    Uint   uint
    Uint8  uint8
    Uint16 uint16
    Uint32 uint32
    Uint64 uint64

    IntString   int   `json:",string"`
    Int8String  int8  `json:",string"`
    Int16String int16 `json:",string"`
    Int32String int32 `json:",string"`
    Int64String int64 `json:",string"`

    UintString   uint   `json:",string"`
    Uint8String  uint8  `json:",string"`
    Uint16String uint16 `json:",string"`
    Uint32String uint32 `json:",string"`
    Uint64String uint64 `json:",string"`

    Float32 float32
    Float64 float64

    Float32String float32 `json:",string"`
    Float64String float64 `json:",string"`

    Ptr    *string
    PtrNil *string
}

type Raw

type Raw struct {
    Field  easyjson.RawMessage
    Field2 string
}

type RequiredOptionalMap

type RequiredOptionalMap struct {
    ReqMap         map[int]string `json:"req_map,required"`
    OmitEmptyMap   map[int]string `json:"oe_map,omitempty"`
    NoOmitEmptyMap map[int]string `json:"noe_map,!omitempty"`
}

type RequiredOptionalStruct

type RequiredOptionalStruct struct {
    FirstName string `json:"first_name,required"`
    Lastname  string `json:"last_name"`
}

type Slices

type Slices struct {
    ByteSlice      []byte
    EmptyByteSlice []byte
    NilByteSlice   []byte
    IntSlice       []int
    EmptyIntSlice  []int
    NilIntSlice    []int
}

type SnakeStruct

type SnakeStruct struct {
    WeirdHTTPStuff   bool
    CustomNamedField string `json:"cUsToM"`
}

type StdMarshaler

type StdMarshaler struct {
    T  time.Time
    IP net.IP
}

type Str

type Str string

type Struct

type Struct struct {
    Test string
}

type Struct1

type Struct1 struct {
}

type Struct2

type Struct2 struct {
    From    *Struct1 `json:"from,omitempty"`
    Through *Struct1 `json:"through,omitempty"`
}

type StructWithInterface

type StructWithInterface struct {
    Field1 int         `json:"f1"`
    Field2 interface{} `json:"f2"`
    Field3 string      `json:"f3"`
}

type StructWithMarshaler

type StructWithMarshaler struct {
    Value int
}

func (*StructWithMarshaler) MarshalEasyJSON

func (s *StructWithMarshaler) MarshalEasyJSON(w *jwriter.Writer)

func (*StructWithMarshaler) UnmarshalEasyJSON

func (s *StructWithMarshaler) UnmarshalEasyJSON(w *jlexer.Lexer)

type StructWithUnknownsProxy

type StructWithUnknownsProxy struct {
    easyjson.UnknownFieldsProxy

    Field1 string
}

type StructWithUnknownsProxyWithOmitempty

type StructWithUnknownsProxyWithOmitempty struct {
    easyjson.UnknownFieldsProxy

    Field1 string `json:",omitempty"`
}

type Structs

type Structs struct {
    SubStruct
    *SubP

    Value2 int

    Sub1   SubStruct `json:"substruct"`
    Sub2   *SubStruct
    SubNil *SubStruct

    SubSlice    []SubStruct
    SubSliceNil []SubStruct

    SubPtrSlice    []*SubStruct
    SubPtrSliceNil []*SubStruct

    SubA1 SubStructAlias
    SubA2 *SubStructAlias

    Anonymous struct {
        V string
        I int
    }
    Anonymous1 *struct {
        V string
    }

    AnonymousSlice    []struct{ V int }
    AnonymousPtrSlice []*struct{ V int }

    Slice []string
    // contains filtered or unexported fields
}

type SubP

type SubP struct {
    V string
}

type SubStruct

type SubStruct struct {
    Value  string
    Value2 string
    // contains filtered or unexported fields
}

type SubStructAlias

type SubStructAlias SubStruct

type TypeDeclared

type TypeDeclared struct {
    Value string
}

type TypeNotDeclared

type TypeNotDeclared struct {
    Value string
}

type TypeNotSkipped

type TypeNotSkipped struct {
    Value string
}

type TypeSkipped

type TypeSkipped struct {
    Value string
}

type UserMarshaler

type UserMarshaler struct {
    V vMarshaler
    T tMarshaler
}