package optional
import "github.com/antihax/optional"
Index ¶
- type Bool
- func EmptyBool() Bool
- func NewBool(value bool) Bool
- func (b Bool) Default(defaultValue bool) bool
- func (b Bool) IsSet() bool
- func (b Bool) Value() bool
- type Byte
- func EmptyByte() Byte
- func NewByte(value byte) Byte
- func (b Byte) Default(defaultValue byte) byte
- func (b Byte) IsSet() bool
- func (b Byte) Value() byte
- type Complex128
- func EmptyComplex128() Complex128
- func NewComplex128(value complex128) Complex128
- func (i Complex128) Default(defaultValue complex128) complex128
- func (i Complex128) IsSet() bool
- func (i Complex128) Value() complex128
- type Complex64
- func EmptyComplex64() Complex64
- func NewComplex64(value complex64) Complex64
- func (i Complex64) Default(defaultValue complex64) complex64
- func (i Complex64) IsSet() bool
- func (i Complex64) Value() complex64
- type Float32
- func EmptyFloat32() Float32
- func NewFloat32(value float32) Float32
- func (i Float32) Default(defaultValue float32) float32
- func (i Float32) IsSet() bool
- func (i Float32) Value() float32
- type Float64
- func EmptyFloat64() Float64
- func NewFloat64(value float64) Float64
- func (i Float64) Default(defaultValue float64) float64
- func (i Float64) IsSet() bool
- func (i Float64) Value() float64
- type Int
- func EmptyInt() Int
- func NewInt(value int) Int
- func (i Int) Default(defaultValue int) int
- func (i Int) IsSet() bool
- func (i Int) Value() int
- type Int16
- func EmptyInt16() Int16
- func NewInt16(value int16) Int16
- func (i Int16) Default(defaultValue int16) int16
- func (i Int16) IsSet() bool
- func (i Int16) Value() int16
- type Int32
- func EmptyInt32() Int32
- func NewInt32(value int32) Int32
- func (i Int32) Default(defaultValue int32) int32
- func (i Int32) IsSet() bool
- func (i Int32) Value() int32
- type Int64
- func EmptyInt64() Int64
- func NewInt64(value int64) Int64
- func (i Int64) Default(defaultValue int64) int64
- func (i Int64) IsSet() bool
- func (i Int64) Value() int64
- type Int8
- func EmptyInt8() Int8
- func NewInt8(value int8) Int8
- func (i Int8) Default(defaultValue int8) int8
- func (i Int8) IsSet() bool
- func (i Int8) Value() int8
- type Interface
- func EmptyInterface() Interface
- func NewInterface(value interface{}) Interface
- func (b Interface) Default(defaultValue interface{}) interface{}
- func (b Interface) IsSet() bool
- func (b Interface) Value() interface{}
- type Rune
- func EmptyRune() Rune
- func NewRune(value rune) Rune
- func (b Rune) Default(defaultValue rune) rune
- func (b Rune) IsSet() bool
- func (b Rune) Value() rune
- type String
- func EmptyString() String
- func NewString(value string) String
- func (b String) Default(defaultValue string) string
- func (b String) IsSet() bool
- func (b String) Value() string
- type Time
- func EmptyTime() Time
- func NewTime(value time.Time) Time
- func (b Time) Default(defaultValue time.Time) time.Time
- func (b Time) IsSet() bool
- func (b Time) Value() time.Time
- type Uint
- func EmptyUint() Uint
- func NewUint(value uint) Uint
- func (i Uint) Default(defaultValue uint) uint
- func (i Uint) IsSet() bool
- func (i Uint) Value() uint
- type Uint16
- func EmptyUint16() Uint16
- func NewUint16(value uint16) Uint16
- func (i Uint16) Default(defaultValue uint16) uint16
- func (i Uint16) IsSet() bool
- func (i Uint16) Value() uint16
- type Uint32
- func EmptyUint32() Uint32
- func NewUint32(value uint32) Uint32
- func (i Uint32) Default(defaultValue uint32) uint32
- func (i Uint32) IsSet() bool
- func (i Uint32) Value() uint32
- type Uint64
- func EmptyUint64() Uint64
- func NewUint64(value uint64) Uint64
- func (i Uint64) Default(defaultValue uint64) uint64
- func (i Uint64) IsSet() bool
- func (i Uint64) Value() uint64
- type Uint8
- func EmptyUint8() Uint8
- func NewUint8(value uint8) Uint8
- func (i Uint8) Default(defaultValue uint8) uint8
- func (i Uint8) IsSet() bool
- func (i Uint8) Value() uint8
- type Uintptr
Types ¶
type Bool ¶
type Bool struct {
// contains filtered or unexported fields
}
func EmptyBool ¶
func EmptyBool() Bool
EmptyBool returns a new Bool that does not have a value set.
func NewBool ¶
func (Bool) Default ¶
func (Bool) IsSet ¶
func (Bool) Value ¶
type Byte ¶
type Byte struct {
// contains filtered or unexported fields
}
func EmptyByte ¶
func EmptyByte() Byte
EmptyByte returns a new Byte that does not have a value set.
func NewByte ¶
func (Byte) Default ¶
func (Byte) IsSet ¶
func (Byte) Value ¶
type Complex128 ¶
type Complex128 struct {
// contains filtered or unexported fields
}
func EmptyComplex128 ¶
func EmptyComplex128() Complex128
EmptyComplex128 returns a new Complex128 that does not have a value set.
func NewComplex128 ¶
func NewComplex128(value complex128) Complex128
func (Complex128) Default ¶
func (i Complex128) Default(defaultValue complex128) complex128
func (Complex128) IsSet ¶
func (i Complex128) IsSet() bool
func (Complex128) Value ¶
func (i Complex128) Value() complex128
type Complex64 ¶
type Complex64 struct {
// contains filtered or unexported fields
}
func EmptyComplex64 ¶
func EmptyComplex64() Complex64
EmptyComplex64 returns a new Complex64 that does not have a value set.
func NewComplex64 ¶
func (Complex64) Default ¶
func (Complex64) IsSet ¶
func (Complex64) Value ¶
type Float32 ¶
type Float32 struct {
// contains filtered or unexported fields
}
func EmptyFloat32 ¶
func EmptyFloat32() Float32
EmptyFloat32 returns a new Float32 that does not have a value set.
func NewFloat32 ¶
func (Float32) Default ¶
func (Float32) IsSet ¶
func (Float32) Value ¶
type Float64 ¶
type Float64 struct {
// contains filtered or unexported fields
}
func EmptyFloat64 ¶
func EmptyFloat64() Float64
EmptyFloat64 returns a new Float64 that does not have a value set.
func NewFloat64 ¶
func (Float64) Default ¶
func (Float64) IsSet ¶
func (Float64) Value ¶
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
func EmptyInt ¶
func EmptyInt() Int
EmptyInt returns a new Int that does not have a value set.
func NewInt ¶
func (Int) Default ¶
func (Int) IsSet ¶
func (Int) Value ¶
type Int16 ¶
type Int16 struct {
// contains filtered or unexported fields
}
func EmptyInt16 ¶
func EmptyInt16() Int16
EmptyInt16 returns a new Int16 that does not have a value set.
func NewInt16 ¶
func (Int16) Default ¶
func (Int16) IsSet ¶
func (Int16) Value ¶
type Int32 ¶
type Int32 struct {
// contains filtered or unexported fields
}
func EmptyInt32 ¶
func EmptyInt32() Int32
EmptyInt32 returns a new Int32 that does not have a value set.
func NewInt32 ¶
func (Int32) Default ¶
func (Int32) IsSet ¶
func (Int32) Value ¶
type Int64 ¶
type Int64 struct {
// contains filtered or unexported fields
}
func EmptyInt64 ¶
func EmptyInt64() Int64
EmptyInt64 returns a new Int64 that does not have a value set.
func NewInt64 ¶
func (Int64) Default ¶
func (Int64) IsSet ¶
func (Int64) Value ¶
type Int8 ¶
type Int8 struct {
// contains filtered or unexported fields
}
func EmptyInt8 ¶
func EmptyInt8() Int8
EmptyInt8 returns a new Int8 that does not have a value set.
func NewInt8 ¶
func (Int8) Default ¶
func (Int8) IsSet ¶
func (Int8) Value ¶
type Interface ¶
type Interface struct {
// contains filtered or unexported fields
}
Optional represents a generic optional type, stored as an interface{}.
func EmptyInterface ¶
func EmptyInterface() Interface
EmptyInterface returns a new Interface that does not have a value set.
func NewInterface ¶
func NewInterface(value interface{}) Interface
func (Interface) Default ¶
func (b Interface) Default(defaultValue interface{}) interface{}
func (Interface) IsSet ¶
func (Interface) Value ¶
func (b Interface) Value() interface{}
type Rune ¶
type Rune struct {
// contains filtered or unexported fields
}
func EmptyRune ¶
func EmptyRune() Rune
EmptyRune returns a new Rune that does not have a value set.
func NewRune ¶
func (Rune) Default ¶
func (Rune) IsSet ¶
func (Rune) Value ¶
type String ¶
type String struct {
// contains filtered or unexported fields
}
func EmptyString ¶
func EmptyString() String
EmptyString returns a new String that does not have a value set.
func NewString ¶
func (String) Default ¶
func (String) IsSet ¶
func (String) Value ¶
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
func EmptyTime ¶
func EmptyTime() Time
EmptyTime returns a new Time that does not have a value set.
func NewTime ¶
func (Time) Default ¶
func (Time) IsSet ¶
func (Time) Value ¶
type Uint ¶
type Uint struct {
// contains filtered or unexported fields
}
func EmptyUint ¶
func EmptyUint() Uint
EmptyUint returns a new Uint that does not have a value set.
func NewUint ¶
func (Uint) Default ¶
func (Uint) IsSet ¶
func (Uint) Value ¶
type Uint16 ¶
type Uint16 struct {
// contains filtered or unexported fields
}
func EmptyUint16 ¶
func EmptyUint16() Uint16
EmptyUint16 returns a new Uint16 that does not have a value set.
func NewUint16 ¶
func (Uint16) Default ¶
func (Uint16) IsSet ¶
func (Uint16) Value ¶
type Uint32 ¶
type Uint32 struct {
// contains filtered or unexported fields
}
func EmptyUint32 ¶
func EmptyUint32() Uint32
EmptyUint32 returns a new Uint32 that does not have a value set.
func NewUint32 ¶
func (Uint32) Default ¶
func (Uint32) IsSet ¶
func (Uint32) Value ¶
type Uint64 ¶
type Uint64 struct {
// contains filtered or unexported fields
}
func EmptyUint64 ¶
func EmptyUint64() Uint64
EmptyUint64 returns a new Uint64 that does not have a value set.
func NewUint64 ¶
func (Uint64) Default ¶
func (Uint64) IsSet ¶
func (Uint64) Value ¶
type Uint8 ¶
type Uint8 struct {
// contains filtered or unexported fields
}
func EmptyUint8 ¶
func EmptyUint8() Uint8
EmptyUint8 returns a new Uint8 that does not have a value set.
func NewUint8 ¶
func (Uint8) Default ¶
func (Uint8) IsSet ¶
func (Uint8) Value ¶
type Uintptr ¶
type Uintptr struct {
// contains filtered or unexported fields
}
func EmptyUintptr ¶
func EmptyUintptr() Uintptr
EmptyUintptr returns a new Uintptr that does not have a value set.
func NewUintptr ¶
func (Uintptr) Default ¶
func (Uintptr) IsSet ¶
func (Uintptr) Value ¶
Source Files ¶
bool.go byte.go complex128.go complex64.go float32.go float64.go int.go int16.go int32.go int64.go int8.go interface.go rune.go string.go time.go uint.go uint16.go uint32.go uint64.go uint8.go uintptr.go
- Version
- v1.0.0 (latest)
- Published
- Oct 10, 2019
- Platform
- linux/amd64
- Imports
- 1 packages
- Last checked
- 2 weeks ago –
Tools for package owners.