example

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 9 Imported by: 0

README

Example for easyjson generation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MyStruct

type MyStruct struct {
	ID   int
	Name string
}

func (MyStruct) MarshalCQL

func (n MyStruct) MarshalCQL(info gocql.TypeInfo) ([]byte, error)

func (MyStruct) MarshalEasyJSON

func (v MyStruct) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (MyStruct) MarshalJSON

func (v MyStruct) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*MyStruct) Scan

func (n *MyStruct) Scan(value interface{}) error

func (*MyStruct) UnmarshalCQL

func (n *MyStruct) UnmarshalCQL(info gocql.TypeInfo, data []byte) error

func (*MyStruct) UnmarshalEasyJSON

func (v *MyStruct) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*MyStruct) UnmarshalJSON

func (v *MyStruct) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (MyStruct) Value

func (n MyStruct) Value() (driver.Value, error)

type MyStruct2

type MyStruct2 struct {
	Val1 NullMyStruct
	Val2 MyStruct
	Val3 NullMyStruct
	Val4 MyStruct
}

func (MyStruct2) MarshalEasyJSON

func (v MyStruct2) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (MyStruct2) MarshalJSON

func (v MyStruct2) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*MyStruct2) UnmarshalEasyJSON

func (v *MyStruct2) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*MyStruct2) UnmarshalJSON

func (v *MyStruct2) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type MyStruct3

type MyStruct3 struct {
	Val1 NullMyStruct
	Val2 MyStruct
	Val3 NullMyStruct
	Val4 MyStruct
}

Struct for test jsoniter encoding Because easyjson generates marshallers for encode/decode and original jsoniter registered functions not used

type NullMyStruct

type NullMyStruct struct {
	MyStruct
	Valid bool // Valid is true if Value is not NULL
}

NullMyStruct - generated for NullMyStruct

func NanMyStruct

func NanMyStruct(v MyStruct) NullMyStruct

func (NullMyStruct) IsValid

func (n NullMyStruct) IsValid() bool

func (NullMyStruct) MarshalCQL

func (n NullMyStruct) MarshalCQL(info gocql.TypeInfo) ([]byte, error)

MarshalCQL - marshaller for cql

func (NullMyStruct) MarshalEasyJSON

func (n NullMyStruct) MarshalEasyJSON(out *jwriter.Writer)

MarshalEasyJSON - marshaller for easyjson

func (NullMyStruct) MarshalJSON

func (n NullMyStruct) MarshalJSON() ([]byte, error)

MarshalJSON - marshaller for json

func (*NullMyStruct) Scan

func (n *NullMyStruct) Scan(value interface{}) error

Scan - scan value from sql driver

func (*NullMyStruct) UnmarshalCQL

func (n *NullMyStruct) UnmarshalCQL(info gocql.TypeInfo, data []byte) error

UnmarshalCQL - unmarshaller for cql

func (*NullMyStruct) UnmarshalEasyJSON

func (n *NullMyStruct) UnmarshalEasyJSON(in *jlexer.Lexer)

UnmarshalEasyJSON - unmarshaller for easyjson

func (*NullMyStruct) UnmarshalJSON

func (n *NullMyStruct) UnmarshalJSON(data []byte) error

UnmarshalJSON - unmarshaller for json

func (NullMyStruct) Value

func (n NullMyStruct) Value() (driver.Value, error)

Value implements the driver Valuer interface.

Jump to

Keyboard shortcuts

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