...

Package opt

import "github.com/mailru/easyjson/opt"
Overview
Index
Subdirectories

Overview ▾

Index ▾

type Bool
    func OBool(v bool) Bool
    func (v Bool) Get(deflt bool) bool
    func (v Bool) IsDefined() bool
    func (v Bool) MarshalEasyJSON(w *jwriter.Writer)
    func (v Bool) MarshalJSON() ([]byte, error)
    func (v Bool) String() string
    func (v *Bool) UnmarshalEasyJSON(l *jlexer.Lexer)
    func (v *Bool) UnmarshalJSON(data []byte) error
type Float32
    func OFloat32(v float32) Float32
    func (v Float32) Get(deflt float32) float32
    func (v Float32) IsDefined() bool
    func (v Float32) MarshalEasyJSON(w *jwriter.Writer)
    func (v Float32) MarshalJSON() ([]byte, error)
    func (v Float32) String() string
    func (v *Float32) UnmarshalEasyJSON(l *jlexer.Lexer)
    func (v *Float32) UnmarshalJSON(data []byte) error
type Float64
    func OFloat64(v float64) Float64
    func (v Float64) Get(deflt float64) float64
    func (v Float64) IsDefined() bool
    func (v Float64) MarshalEasyJSON(w *jwriter.Writer)
    func (v Float64) MarshalJSON() ([]byte, error)
    func (v Float64) String() string
    func (v *Float64) UnmarshalEasyJSON(l *jlexer.Lexer)
    func (v *Float64) UnmarshalJSON(data []byte) error
type Int
    func OInt(v int) Int
    func (v Int) Get(deflt int) int
    func (v Int) IsDefined() bool
    func (v Int) MarshalEasyJSON(w *jwriter.Writer)
    func (v Int) MarshalJSON() ([]byte, error)
    func (v Int) String() string
    func (v *Int) UnmarshalEasyJSON(l *jlexer.Lexer)
    func (v *Int) UnmarshalJSON(data []byte) error
type Int16
    func OInt16(v int16) Int16
    func (v Int16) Get(deflt int16) int16
    func (v Int16) IsDefined() bool
    func (v Int16) MarshalEasyJSON(w *jwriter.Writer)
    func (v Int16) MarshalJSON() ([]byte, error)
    func (v Int16) String() string
    func (v *Int16) UnmarshalEasyJSON(l *jlexer.Lexer)
    func (v *Int16) UnmarshalJSON(data []byte) error
type Int32
    func OInt32(v int32) Int32
    func (v Int32) Get(deflt int32) int32
    func (v Int32) IsDefined() bool
    func (v Int32) MarshalEasyJSON(w *jwriter.Writer)
    func (v Int32) MarshalJSON() ([]byte, error)
    func (v Int32) String() string
    func (v *Int32) UnmarshalEasyJSON(l *jlexer.Lexer)
    func (v *Int32) UnmarshalJSON(data []byte) error
type Int64
    func OInt64(v int64) Int64
    func (v Int64) Get(deflt int64) int64
    func (v Int64) IsDefined() bool
    func (v Int64) MarshalEasyJSON(w *jwriter.Writer)
    func (v Int64) MarshalJSON() ([]byte, error)
    func (v Int64) String() string
    func (v *Int64) UnmarshalEasyJSON(l *jlexer.Lexer)
    func (v *Int64) UnmarshalJSON(data []byte) error
type Int8
    func OInt8(v int8) Int8
    func (v Int8) Get(deflt int8) int8
    func (v Int8) IsDefined() bool
    func (v Int8) MarshalEasyJSON(w *jwriter.Writer)
    func (v Int8) MarshalJSON() ([]byte, error)
    func (v Int8) String() string
    func (v *Int8) UnmarshalEasyJSON(l *jlexer.Lexer)
    func (v *Int8) UnmarshalJSON(data []byte) error
type String
    func OString(v string) String
    func (v String) Get(deflt string) string
    func (v String) IsDefined() bool
    func (v String) MarshalEasyJSON(w *jwriter.Writer)
    func (v String) MarshalJSON() ([]byte, error)
    func (v String) String() string
    func (v *String) UnmarshalEasyJSON(l *jlexer.Lexer)
    func (v *String) UnmarshalJSON(data []byte) error
type Uint
    func OUint(v uint) Uint
    func (v Uint) Get(deflt uint) uint
    func (v Uint) IsDefined() bool
    func (v Uint) MarshalEasyJSON(w *jwriter.Writer)
    func (v Uint) MarshalJSON() ([]byte, error)
    func (v Uint) String() string
    func (v *Uint) UnmarshalEasyJSON(l *jlexer.Lexer)
    func (v *Uint) UnmarshalJSON(data []byte) error
type Uint16
    func OUint16(v uint16) Uint16
    func (v Uint16) Get(deflt uint16) uint16
    func (v Uint16) IsDefined() bool
    func (v Uint16) MarshalEasyJSON(w *jwriter.Writer)
    func (v Uint16) MarshalJSON() ([]byte, error)
    func (v Uint16) String() string
    func (v *Uint16) UnmarshalEasyJSON(l *jlexer.Lexer)
    func (v *Uint16) UnmarshalJSON(data []byte) error
type Uint32
    func OUint32(v uint32) Uint32
    func (v Uint32) Get(deflt uint32) uint32
    func (v Uint32) IsDefined() bool
    func (v Uint32) MarshalEasyJSON(w *jwriter.Writer)
    func (v Uint32) MarshalJSON() ([]byte, error)
    func (v Uint32) String() string
    func (v *Uint32) UnmarshalEasyJSON(l *jlexer.Lexer)
    func (v *Uint32) UnmarshalJSON(data []byte) error
type Uint64
    func OUint64(v uint64) Uint64
    func (v Uint64) Get(deflt uint64) uint64
    func (v Uint64) IsDefined() bool
    func (v Uint64) MarshalEasyJSON(w *jwriter.Writer)
    func (v Uint64) MarshalJSON() ([]byte, error)
    func (v Uint64) String() string
    func (v *Uint64) UnmarshalEasyJSON(l *jlexer.Lexer)
    func (v *Uint64) UnmarshalJSON(data []byte) error
type Uint8
    func OUint8(v uint8) Uint8
    func (v Uint8) Get(deflt uint8) uint8
    func (v Uint8) IsDefined() bool
    func (v Uint8) MarshalEasyJSON(w *jwriter.Writer)
    func (v Uint8) MarshalJSON() ([]byte, error)
    func (v Uint8) String() string
    func (v *Uint8) UnmarshalEasyJSON(l *jlexer.Lexer)
    func (v *Uint8) UnmarshalJSON(data []byte) error

Package files

gotemplate_Bool.go gotemplate_Float32.go gotemplate_Float64.go gotemplate_Int.go gotemplate_Int16.go gotemplate_Int32.go gotemplate_Int64.go gotemplate_Int8.go gotemplate_String.go gotemplate_Uint.go gotemplate_Uint16.go gotemplate_Uint32.go gotemplate_Uint64.go gotemplate_Uint8.go opts.go

type Bool

A 'gotemplate'-based type for providing optional semantics without using pointers.

type Bool struct {
    V       bool
    Defined bool
}

func OBool

func OBool(v bool) Bool

Creates an optional type with a given value.

func (Bool) Get

func (v Bool) Get(deflt bool) bool

Get returns the value or given default in the case the value is undefined.

func (Bool) IsDefined

func (v Bool) IsDefined() bool

IsDefined returns whether the value is defined, a function is required so that it can be used in an interface.

func (Bool) MarshalEasyJSON

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

MarshalEasyJSON does JSON marshaling using easyjson interface.

func (Bool) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Bool) String

func (v Bool) String() string

String implements a stringer interface using fmt.Sprint for the value.

func (*Bool) UnmarshalEasyJSON

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

UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.

func (*Bool) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

type Float32

A 'gotemplate'-based type for providing optional semantics without using pointers.

type Float32 struct {
    V       float32
    Defined bool
}

func OFloat32

func OFloat32(v float32) Float32

Creates an optional type with a given value.

func (Float32) Get

func (v Float32) Get(deflt float32) float32

Get returns the value or given default in the case the value is undefined.

func (Float32) IsDefined

func (v Float32) IsDefined() bool

IsDefined returns whether the value is defined, a function is required so that it can be used in an interface.

func (Float32) MarshalEasyJSON

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

MarshalEasyJSON does JSON marshaling using easyjson interface.

func (Float32) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Float32) String

func (v Float32) String() string

String implements a stringer interface using fmt.Sprint for the value.

func (*Float32) UnmarshalEasyJSON

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

UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.

func (*Float32) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

type Float64

A 'gotemplate'-based type for providing optional semantics without using pointers.

type Float64 struct {
    V       float64
    Defined bool
}

func OFloat64

func OFloat64(v float64) Float64

Creates an optional type with a given value.

func (Float64) Get

func (v Float64) Get(deflt float64) float64

Get returns the value or given default in the case the value is undefined.

func (Float64) IsDefined

func (v Float64) IsDefined() bool

IsDefined returns whether the value is defined, a function is required so that it can be used in an interface.

func (Float64) MarshalEasyJSON

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

MarshalEasyJSON does JSON marshaling using easyjson interface.

func (Float64) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Float64) String

func (v Float64) String() string

String implements a stringer interface using fmt.Sprint for the value.

func (*Float64) UnmarshalEasyJSON

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

UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.

func (*Float64) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

type Int

A 'gotemplate'-based type for providing optional semantics without using pointers.

type Int struct {
    V       int
    Defined bool
}

func OInt

func OInt(v int) Int

Creates an optional type with a given value.

func (Int) Get

func (v Int) Get(deflt int) int

Get returns the value or given default in the case the value is undefined.

func (Int) IsDefined

func (v Int) IsDefined() bool

IsDefined returns whether the value is defined, a function is required so that it can be used in an interface.

func (Int) MarshalEasyJSON

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

MarshalEasyJSON does JSON marshaling using easyjson interface.

func (Int) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Int) String

func (v Int) String() string

String implements a stringer interface using fmt.Sprint for the value.

func (*Int) UnmarshalEasyJSON

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

UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.

func (*Int) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

type Int16

A 'gotemplate'-based type for providing optional semantics without using pointers.

type Int16 struct {
    V       int16
    Defined bool
}

func OInt16

func OInt16(v int16) Int16

Creates an optional type with a given value.

func (Int16) Get

func (v Int16) Get(deflt int16) int16

Get returns the value or given default in the case the value is undefined.

func (Int16) IsDefined

func (v Int16) IsDefined() bool

IsDefined returns whether the value is defined, a function is required so that it can be used in an interface.

func (Int16) MarshalEasyJSON

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

MarshalEasyJSON does JSON marshaling using easyjson interface.

func (Int16) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Int16) String

func (v Int16) String() string

String implements a stringer interface using fmt.Sprint for the value.

func (*Int16) UnmarshalEasyJSON

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

UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.

func (*Int16) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

type Int32

A 'gotemplate'-based type for providing optional semantics without using pointers.

type Int32 struct {
    V       int32
    Defined bool
}

func OInt32

func OInt32(v int32) Int32

Creates an optional type with a given value.

func (Int32) Get

func (v Int32) Get(deflt int32) int32

Get returns the value or given default in the case the value is undefined.

func (Int32) IsDefined

func (v Int32) IsDefined() bool

IsDefined returns whether the value is defined, a function is required so that it can be used in an interface.

func (Int32) MarshalEasyJSON

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

MarshalEasyJSON does JSON marshaling using easyjson interface.

func (Int32) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Int32) String

func (v Int32) String() string

String implements a stringer interface using fmt.Sprint for the value.

func (*Int32) UnmarshalEasyJSON

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

UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.

func (*Int32) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

type Int64

A 'gotemplate'-based type for providing optional semantics without using pointers.

type Int64 struct {
    V       int64
    Defined bool
}

func OInt64

func OInt64(v int64) Int64

Creates an optional type with a given value.

func (Int64) Get

func (v Int64) Get(deflt int64) int64

Get returns the value or given default in the case the value is undefined.

func (Int64) IsDefined

func (v Int64) IsDefined() bool

IsDefined returns whether the value is defined, a function is required so that it can be used in an interface.

func (Int64) MarshalEasyJSON

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

MarshalEasyJSON does JSON marshaling using easyjson interface.

func (Int64) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Int64) String

func (v Int64) String() string

String implements a stringer interface using fmt.Sprint for the value.

func (*Int64) UnmarshalEasyJSON

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

UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.

func (*Int64) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

type Int8

A 'gotemplate'-based type for providing optional semantics without using pointers.

type Int8 struct {
    V       int8
    Defined bool
}

func OInt8

func OInt8(v int8) Int8

Creates an optional type with a given value.

func (Int8) Get

func (v Int8) Get(deflt int8) int8

Get returns the value or given default in the case the value is undefined.

func (Int8) IsDefined

func (v Int8) IsDefined() bool

IsDefined returns whether the value is defined, a function is required so that it can be used in an interface.

func (Int8) MarshalEasyJSON

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

MarshalEasyJSON does JSON marshaling using easyjson interface.

func (Int8) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Int8) String

func (v Int8) String() string

String implements a stringer interface using fmt.Sprint for the value.

func (*Int8) UnmarshalEasyJSON

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

UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.

func (*Int8) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

type String

A 'gotemplate'-based type for providing optional semantics without using pointers.

type String struct {
    V       string
    Defined bool
}

func OString

func OString(v string) String

Creates an optional type with a given value.

func (String) Get

func (v String) Get(deflt string) string

Get returns the value or given default in the case the value is undefined.

func (String) IsDefined

func (v String) IsDefined() bool

IsDefined returns whether the value is defined, a function is required so that it can be used in an interface.

func (String) MarshalEasyJSON

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

MarshalEasyJSON does JSON marshaling using easyjson interface.

func (String) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (String) String

func (v String) String() string

String implements a stringer interface using fmt.Sprint for the value.

func (*String) UnmarshalEasyJSON

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

UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.

func (*String) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

type Uint

A 'gotemplate'-based type for providing optional semantics without using pointers.

type Uint struct {
    V       uint
    Defined bool
}

func OUint

func OUint(v uint) Uint

Creates an optional type with a given value.

func (Uint) Get

func (v Uint) Get(deflt uint) uint

Get returns the value or given default in the case the value is undefined.

func (Uint) IsDefined

func (v Uint) IsDefined() bool

IsDefined returns whether the value is defined, a function is required so that it can be used in an interface.

func (Uint) MarshalEasyJSON

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

MarshalEasyJSON does JSON marshaling using easyjson interface.

func (Uint) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Uint) String

func (v Uint) String() string

String implements a stringer interface using fmt.Sprint for the value.

func (*Uint) UnmarshalEasyJSON

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

UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.

func (*Uint) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

type Uint16

A 'gotemplate'-based type for providing optional semantics without using pointers.

type Uint16 struct {
    V       uint16
    Defined bool
}

func OUint16

func OUint16(v uint16) Uint16

Creates an optional type with a given value.

func (Uint16) Get

func (v Uint16) Get(deflt uint16) uint16

Get returns the value or given default in the case the value is undefined.

func (Uint16) IsDefined

func (v Uint16) IsDefined() bool

IsDefined returns whether the value is defined, a function is required so that it can be used in an interface.

func (Uint16) MarshalEasyJSON

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

MarshalEasyJSON does JSON marshaling using easyjson interface.

func (Uint16) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Uint16) String

func (v Uint16) String() string

String implements a stringer interface using fmt.Sprint for the value.

func (*Uint16) UnmarshalEasyJSON

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

UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.

func (*Uint16) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

type Uint32

A 'gotemplate'-based type for providing optional semantics without using pointers.

type Uint32 struct {
    V       uint32
    Defined bool
}

func OUint32

func OUint32(v uint32) Uint32

Creates an optional type with a given value.

func (Uint32) Get

func (v Uint32) Get(deflt uint32) uint32

Get returns the value or given default in the case the value is undefined.

func (Uint32) IsDefined

func (v Uint32) IsDefined() bool

IsDefined returns whether the value is defined, a function is required so that it can be used in an interface.

func (Uint32) MarshalEasyJSON

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

MarshalEasyJSON does JSON marshaling using easyjson interface.

func (Uint32) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Uint32) String

func (v Uint32) String() string

String implements a stringer interface using fmt.Sprint for the value.

func (*Uint32) UnmarshalEasyJSON

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

UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.

func (*Uint32) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

type Uint64

A 'gotemplate'-based type for providing optional semantics without using pointers.

type Uint64 struct {
    V       uint64
    Defined bool
}

func OUint64

func OUint64(v uint64) Uint64

Creates an optional type with a given value.

func (Uint64) Get

func (v Uint64) Get(deflt uint64) uint64

Get returns the value or given default in the case the value is undefined.

func (Uint64) IsDefined

func (v Uint64) IsDefined() bool

IsDefined returns whether the value is defined, a function is required so that it can be used in an interface.

func (Uint64) MarshalEasyJSON

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

MarshalEasyJSON does JSON marshaling using easyjson interface.

func (Uint64) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Uint64) String

func (v Uint64) String() string

String implements a stringer interface using fmt.Sprint for the value.

func (*Uint64) UnmarshalEasyJSON

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

UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.

func (*Uint64) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

type Uint8

A 'gotemplate'-based type for providing optional semantics without using pointers.

type Uint8 struct {
    V       uint8
    Defined bool
}

func OUint8

func OUint8(v uint8) Uint8

Creates an optional type with a given value.

func (Uint8) Get

func (v Uint8) Get(deflt uint8) uint8

Get returns the value or given default in the case the value is undefined.

func (Uint8) IsDefined

func (v Uint8) IsDefined() bool

IsDefined returns whether the value is defined, a function is required so that it can be used in an interface.

func (Uint8) MarshalEasyJSON

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

MarshalEasyJSON does JSON marshaling using easyjson interface.

func (Uint8) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Uint8) String

func (v Uint8) String() string

String implements a stringer interface using fmt.Sprint for the value.

func (*Uint8) UnmarshalEasyJSON

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

UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.

func (*Uint8) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

Subdirectories

Name Synopsis
..
optional