opt

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool struct {
	V       bool
	Defined bool
}

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

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) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Bool) MarshalTinyJSON

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

MarshalTinyJSON does JSON marshaling using tinyjson interface.

func (Bool) String

func (v Bool) String() string

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

func (*Bool) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

func (*Bool) UnmarshalTinyJSON

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

UnmarshalTinyJSON does JSON unmarshaling using tinyjson interface.

type Int

type Int struct {
	V       int
	Defined bool
}

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

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) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Int) MarshalTinyJSON

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

MarshalTinyJSON does JSON marshaling using tinyjson interface.

func (Int) String

func (v Int) String() string

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

func (*Int) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

func (*Int) UnmarshalTinyJSON

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

UnmarshalTinyJSON does JSON unmarshaling using tinyjson interface.

type Int16

type Int16 struct {
	V       int16
	Defined bool
}

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

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) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Int16) MarshalTinyJSON

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

MarshalTinyJSON does JSON marshaling using tinyjson interface.

func (Int16) String

func (v Int16) String() string

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

func (*Int16) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

func (*Int16) UnmarshalTinyJSON

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

UnmarshalTinyJSON does JSON unmarshaling using tinyjson interface.

type Int32

type Int32 struct {
	V       int32
	Defined bool
}

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

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) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Int32) MarshalTinyJSON

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

MarshalTinyJSON does JSON marshaling using tinyjson interface.

func (Int32) String

func (v Int32) String() string

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

func (*Int32) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

func (*Int32) UnmarshalTinyJSON

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

UnmarshalTinyJSON does JSON unmarshaling using tinyjson interface.

type Int64

type Int64 struct {
	V       int64
	Defined bool
}

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

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) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Int64) MarshalTinyJSON

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

MarshalTinyJSON does JSON marshaling using tinyjson interface.

func (Int64) String

func (v Int64) String() string

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

func (*Int64) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

func (*Int64) UnmarshalTinyJSON

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

UnmarshalTinyJSON does JSON unmarshaling using tinyjson interface.

type Int8

type Int8 struct {
	V       int8
	Defined bool
}

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

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) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Int8) MarshalTinyJSON

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

MarshalTinyJSON does JSON marshaling using tinyjson interface.

func (Int8) String

func (v Int8) String() string

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

func (*Int8) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

func (*Int8) UnmarshalTinyJSON

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

UnmarshalTinyJSON does JSON unmarshaling using tinyjson interface.

type String

type String struct {
	V       string
	Defined bool
}

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

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) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (String) MarshalTinyJSON

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

MarshalTinyJSON does JSON marshaling using tinyjson interface.

func (String) String

func (v String) String() string

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

func (*String) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

func (*String) UnmarshalTinyJSON

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

UnmarshalTinyJSON does JSON unmarshaling using tinyjson interface.

type Uint

type Uint struct {
	V       uint
	Defined bool
}

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

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) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Uint) MarshalTinyJSON

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

MarshalTinyJSON does JSON marshaling using tinyjson interface.

func (Uint) String

func (v Uint) String() string

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

func (*Uint) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

func (*Uint) UnmarshalTinyJSON

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

UnmarshalTinyJSON does JSON unmarshaling using tinyjson interface.

type Uint16

type Uint16 struct {
	V       uint16
	Defined bool
}

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

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) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Uint16) MarshalTinyJSON

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

MarshalTinyJSON does JSON marshaling using tinyjson interface.

func (Uint16) String

func (v Uint16) String() string

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

func (*Uint16) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

func (*Uint16) UnmarshalTinyJSON

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

UnmarshalTinyJSON does JSON unmarshaling using tinyjson interface.

type Uint32

type Uint32 struct {
	V       uint32
	Defined bool
}

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

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) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Uint32) MarshalTinyJSON

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

MarshalTinyJSON does JSON marshaling using tinyjson interface.

func (Uint32) String

func (v Uint32) String() string

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

func (*Uint32) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

func (*Uint32) UnmarshalTinyJSON

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

UnmarshalTinyJSON does JSON unmarshaling using tinyjson interface.

type Uint64

type Uint64 struct {
	V       uint64
	Defined bool
}

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

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) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Uint64) MarshalTinyJSON

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

MarshalTinyJSON does JSON marshaling using tinyjson interface.

func (Uint64) String

func (v Uint64) String() string

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

func (*Uint64) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

func (*Uint64) UnmarshalTinyJSON

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

UnmarshalTinyJSON does JSON unmarshaling using tinyjson interface.

type Uint8

type Uint8 struct {
	V       uint8
	Defined bool
}

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

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) MarshalJSON

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

MarshalJSON implements a standard json marshaler interface.

func (Uint8) MarshalTinyJSON

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

MarshalTinyJSON does JSON marshaling using tinyjson interface.

func (Uint8) String

func (v Uint8) String() string

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

func (*Uint8) UnmarshalJSON

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

UnmarshalJSON implements a standard json unmarshaler interface.

func (*Uint8) UnmarshalTinyJSON

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

UnmarshalTinyJSON does JSON unmarshaling using tinyjson interface.

Jump to

Keyboard shortcuts

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