optional

package module
v0.0.0-...-5e0d6b7 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 8 Imported by: 2

README

IsNil

not null value

IsPresent

just not IsBlank

IsBlank

just false,empty string,empty bytes will be blank

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool optionalBool

func EmptyBool

func EmptyBool() Bool

Empty returns an empty optional.

func OfBool

func OfBool(value bool) Bool

Of wraps the value in an optional.

func OfBoolPtr

func OfBoolPtr(ptr *bool) Bool

func (Bool) Else

func (o Bool) Else(elseValue bool) (value bool)

Else returns the value wrapped by this optional, or the value passed in if there is no value wrapped by this optional.

func (Bool) ElseFunc

func (o Bool) ElseFunc(f func() bool) (value bool)

func (Bool) Get

func (o Bool) Get() (value bool, ok bool)

Get returns the value wrapped by this optional, and an ok signal for whether a value was wrapped.

func (Bool) GormDataType

func (c Bool) GormDataType() string

func (Bool) If

func (o Bool) If(f func(value bool))

If calls the function if there is a value wrapped by this optional.

func (Bool) IsBlank

func (o Bool) IsBlank() bool

func (Bool) IsNil

func (o Bool) IsNil() bool

func (Bool) IsPresent

func (o Bool) IsPresent() bool

func (Bool) MarshalJSON

func (o Bool) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the value being wrapped to JSON. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Bool) MarshalText

func (o *Bool) MarshalText() ([]byte, error)

func (Bool) MarshalXML

func (o Bool) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the value being wrapped to XML. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Bool) Scan

func (c *Bool) Scan(input interface{}) (err error)

func (Bool) String

func (o Bool) String() string

String returns the string representation of the wrapped value, or the string representation of the zero value of the type wrapped if there is no value wrapped by this optional.

func (*Bool) UnmarshalJSON

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

UnmarshalJSON unmarshals the JSON into a value wrapped by this optional.

func (*Bool) UnmarshalText

func (o *Bool) UnmarshalText(data []byte) error

func (*Bool) UnmarshalXML

func (o *Bool) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the XML into a value wrapped by this optional.

func (Bool) V

func (o Bool) V() (value bool)

V returns the value wrapped by this optional, or the zero value of the type wrapped if there is no value wrapped by this optional.

func (Bool) Value

func (c Bool) Value() (driver.Value, error)

type Byte

type Byte optionalByte

func EmptyByte

func EmptyByte() Byte

Empty returns an empty optional.

func OfByte

func OfByte(value byte) Byte

Of wraps the value in an optional.

func OfBytePtr

func OfBytePtr(ptr *byte) Byte

func (Byte) Else

func (o Byte) Else(elseValue byte) (value byte)

Else returns the value wrapped by this optional, or the value passed in if there is no value wrapped by this optional.

func (Byte) ElseFunc

func (o Byte) ElseFunc(f func() byte) (value byte)

func (Byte) Get

func (o Byte) Get() (value byte, ok bool)

Get returns the value wrapped by this optional, and an ok signal for whether a value was wrapped.

func (Byte) GormDataType

func (c Byte) GormDataType() string

func (Byte) If

func (o Byte) If(f func(value byte))

If calls the function if there is a value wrapped by this optional.

func (Byte) IsBlank

func (o Byte) IsBlank() bool

func (Byte) IsNil

func (o Byte) IsNil() bool

func (Byte) IsPresent

func (o Byte) IsPresent() bool

func (Byte) MarshalJSON

func (o Byte) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the value being wrapped to JSON. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Byte) MarshalText

func (o *Byte) MarshalText() ([]byte, error)

func (Byte) MarshalXML

func (o Byte) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the value being wrapped to XML. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Byte) Scan

func (c *Byte) Scan(input interface{}) (err error)

func (Byte) String

func (o Byte) String() string

String returns the string representation of the wrapped value, or the string representation of the zero value of the type wrapped if there is no value wrapped by this optional.

func (*Byte) UnmarshalJSON

func (o *Byte) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the JSON into a value wrapped by this optional.

func (*Byte) UnmarshalText

func (o *Byte) UnmarshalText(data []byte) error

func (*Byte) UnmarshalXML

func (o *Byte) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the XML into a value wrapped by this optional.

func (Byte) V

func (o Byte) V() (value byte)

V returns the value wrapped by this optional, or the zero value of the type wrapped if there is no value wrapped by this optional.

func (Byte) Value

func (c Byte) Value() (driver.Value, error)

type Float32

type Float32 optionalFloat32

func EmptyFloat32

func EmptyFloat32() Float32

Empty returns an empty optional.

func OfFloat32

func OfFloat32(value float32) Float32

Of wraps the value in an optional.

func OfFloat32Ptr

func OfFloat32Ptr(ptr *float32) Float32

func (Float32) Else

func (o Float32) Else(elseValue float32) (value float32)

Else returns the value wrapped by this optional, or the value passed in if there is no value wrapped by this optional.

func (Float32) ElseFunc

func (o Float32) ElseFunc(f func() float32) (value float32)

func (Float32) Get

func (o Float32) Get() (value float32, ok bool)

Get returns the value wrapped by this optional, and an ok signal for whether a value was wrapped.

func (Float32) GormDataType

func (c Float32) GormDataType() string

func (Float32) If

func (o Float32) If(f func(value float32))

If calls the function if there is a value wrapped by this optional.

func (Float32) IsBlank

func (o Float32) IsBlank() bool

func (Float32) IsNil

func (o Float32) IsNil() bool

func (Float32) IsPresent

func (o Float32) IsPresent() bool

func (Float32) MarshalJSON

func (o Float32) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the value being wrapped to JSON. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Float32) MarshalText

func (o *Float32) MarshalText() ([]byte, error)

func (Float32) MarshalXML

func (o Float32) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the value being wrapped to XML. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Float32) Scan

func (c *Float32) Scan(input interface{}) (err error)

func (Float32) String

func (o Float32) String() string

String returns the string representation of the wrapped value, or the string representation of the zero value of the type wrapped if there is no value wrapped by this optional.

func (*Float32) UnmarshalJSON

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

UnmarshalJSON unmarshals the JSON into a value wrapped by this optional.

func (*Float32) UnmarshalText

func (o *Float32) UnmarshalText(data []byte) error

func (*Float32) UnmarshalXML

func (o *Float32) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the XML into a value wrapped by this optional.

func (Float32) V

func (o Float32) V() (value float32)

V returns the value wrapped by this optional, or the zero value of the type wrapped if there is no value wrapped by this optional.

func (Float32) Value

func (c Float32) Value() (driver.Value, error)

type Float64

type Float64 optionalFloat64

func EmptyFloat64

func EmptyFloat64() Float64

Empty returns an empty optional.

func OfFloat64

func OfFloat64(value float64) Float64

Of wraps the value in an optional.

func OfFloat64Ptr

func OfFloat64Ptr(ptr *float64) Float64

func (Float64) Else

func (o Float64) Else(elseValue float64) (value float64)

Else returns the value wrapped by this optional, or the value passed in if there is no value wrapped by this optional.

func (Float64) ElseFunc

func (o Float64) ElseFunc(f func() float64) (value float64)

func (Float64) Get

func (o Float64) Get() (value float64, ok bool)

Get returns the value wrapped by this optional, and an ok signal for whether a value was wrapped.

func (Float64) GormDataType

func (c Float64) GormDataType() string

func (Float64) If

func (o Float64) If(f func(value float64))

If calls the function if there is a value wrapped by this optional.

func (Float64) IsBlank

func (o Float64) IsBlank() bool

func (Float64) IsNil

func (o Float64) IsNil() bool

func (Float64) IsPresent

func (o Float64) IsPresent() bool

func (Float64) MarshalJSON

func (o Float64) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the value being wrapped to JSON. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Float64) MarshalText

func (o *Float64) MarshalText() ([]byte, error)

func (Float64) MarshalXML

func (o Float64) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the value being wrapped to XML. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Float64) Scan

func (c *Float64) Scan(input interface{}) (err error)

func (Float64) String

func (o Float64) String() string

String returns the string representation of the wrapped value, or the string representation of the zero value of the type wrapped if there is no value wrapped by this optional.

func (*Float64) UnmarshalJSON

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

UnmarshalJSON unmarshals the JSON into a value wrapped by this optional.

func (*Float64) UnmarshalText

func (o *Float64) UnmarshalText(data []byte) error

func (*Float64) UnmarshalXML

func (o *Float64) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the XML into a value wrapped by this optional.

func (Float64) V

func (o Float64) V() (value float64)

V returns the value wrapped by this optional, or the zero value of the type wrapped if there is no value wrapped by this optional.

func (Float64) Value

func (c Float64) Value() (driver.Value, error)

type Int

type Int optionalInt

func EmptyInt

func EmptyInt() Int

Empty returns an empty optional.

func OfInt

func OfInt(value int) Int

Of wraps the value in an optional.

func OfIntPtr

func OfIntPtr(ptr *int) Int

func (Int) Else

func (o Int) Else(elseValue int) (value int)

Else returns the value wrapped by this optional, or the value passed in if there is no value wrapped by this optional.

func (Int) ElseFunc

func (o Int) ElseFunc(f func() int) (value int)

func (Int) Get

func (o Int) Get() (value int, ok bool)

Get returns the value wrapped by this optional, and an ok signal for whether a value was wrapped.

func (Int) GormDataType

func (c Int) GormDataType() string

func (Int) If

func (o Int) If(f func(value int))

If calls the function if there is a value wrapped by this optional.

func (Int) IsBlank

func (o Int) IsBlank() bool

func (Int) IsNil

func (o Int) IsNil() bool

func (Int) IsPresent

func (o Int) IsPresent() bool

func (Int) MarshalJSON

func (o Int) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the value being wrapped to JSON. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Int) MarshalText

func (o *Int) MarshalText() ([]byte, error)

func (Int) MarshalXML

func (o Int) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the value being wrapped to XML. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Int) Scan

func (c *Int) Scan(input interface{}) (err error)

func (Int) String

func (o Int) String() string

String returns the string representation of the wrapped value, or the string representation of the zero value of the type wrapped if there is no value wrapped by this optional.

func (*Int) UnmarshalJSON

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

UnmarshalJSON unmarshals the JSON into a value wrapped by this optional.

func (*Int) UnmarshalText

func (o *Int) UnmarshalText(data []byte) error

func (*Int) UnmarshalXML

func (o *Int) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the XML into a value wrapped by this optional.

func (Int) V

func (o Int) V() (value int)

V returns the value wrapped by this optional, or the zero value of the type wrapped if there is no value wrapped by this optional.

func (Int) Value

func (c Int) Value() (driver.Value, error)

type Int16

type Int16 optionalInt16

func EmptyInt16

func EmptyInt16() Int16

Empty returns an empty optional.

func OfInt16

func OfInt16(value int16) Int16

Of wraps the value in an optional.

func OfInt16Ptr

func OfInt16Ptr(ptr *int16) Int16

func (Int16) Else

func (o Int16) Else(elseValue int16) (value int16)

Else returns the value wrapped by this optional, or the value passed in if there is no value wrapped by this optional.

func (Int16) ElseFunc

func (o Int16) ElseFunc(f func() int16) (value int16)

func (Int16) Get

func (o Int16) Get() (value int16, ok bool)

Get returns the value wrapped by this optional, and an ok signal for whether a value was wrapped.

func (Int16) GormDataType

func (c Int16) GormDataType() string

func (Int16) If

func (o Int16) If(f func(value int16))

If calls the function if there is a value wrapped by this optional.

func (Int16) IsBlank

func (o Int16) IsBlank() bool

func (Int16) IsNil

func (o Int16) IsNil() bool

func (Int16) IsPresent

func (o Int16) IsPresent() bool

func (Int16) MarshalJSON

func (o Int16) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the value being wrapped to JSON. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Int16) MarshalText

func (o *Int16) MarshalText() ([]byte, error)

func (Int16) MarshalXML

func (o Int16) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the value being wrapped to XML. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Int16) Scan

func (c *Int16) Scan(input interface{}) (err error)

func (Int16) String

func (o Int16) String() string

String returns the string representation of the wrapped value, or the string representation of the zero value of the type wrapped if there is no value wrapped by this optional.

func (*Int16) UnmarshalJSON

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

UnmarshalJSON unmarshals the JSON into a value wrapped by this optional.

func (*Int16) UnmarshalText

func (o *Int16) UnmarshalText(data []byte) error

func (*Int16) UnmarshalXML

func (o *Int16) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the XML into a value wrapped by this optional.

func (Int16) V

func (o Int16) V() (value int16)

V returns the value wrapped by this optional, or the zero value of the type wrapped if there is no value wrapped by this optional.

func (Int16) Value

func (c Int16) Value() (driver.Value, error)

type Int32

type Int32 optionalInt32

func EmptyInt32

func EmptyInt32() Int32

Empty returns an empty optional.

func OfInt32

func OfInt32(value int32) Int32

Of wraps the value in an optional.

func OfInt32Ptr

func OfInt32Ptr(ptr *int32) Int32

func (Int32) Else

func (o Int32) Else(elseValue int32) (value int32)

Else returns the value wrapped by this optional, or the value passed in if there is no value wrapped by this optional.

func (Int32) ElseFunc

func (o Int32) ElseFunc(f func() int32) (value int32)

func (Int32) Get

func (o Int32) Get() (value int32, ok bool)

Get returns the value wrapped by this optional, and an ok signal for whether a value was wrapped.

func (Int32) GormDataType

func (c Int32) GormDataType() string

func (Int32) If

func (o Int32) If(f func(value int32))

If calls the function if there is a value wrapped by this optional.

func (Int32) IsBlank

func (o Int32) IsBlank() bool

func (Int32) IsNil

func (o Int32) IsNil() bool

func (Int32) IsPresent

func (o Int32) IsPresent() bool

func (Int32) MarshalJSON

func (o Int32) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the value being wrapped to JSON. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Int32) MarshalText

func (o *Int32) MarshalText() ([]byte, error)

func (Int32) MarshalXML

func (o Int32) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the value being wrapped to XML. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Int32) Scan

func (c *Int32) Scan(input interface{}) (err error)

func (Int32) String

func (o Int32) String() string

String returns the string representation of the wrapped value, or the string representation of the zero value of the type wrapped if there is no value wrapped by this optional.

func (*Int32) UnmarshalJSON

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

UnmarshalJSON unmarshals the JSON into a value wrapped by this optional.

func (*Int32) UnmarshalText

func (o *Int32) UnmarshalText(data []byte) error

func (*Int32) UnmarshalXML

func (o *Int32) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the XML into a value wrapped by this optional.

func (Int32) V

func (o Int32) V() (value int32)

V returns the value wrapped by this optional, or the zero value of the type wrapped if there is no value wrapped by this optional.

func (Int32) Value

func (c Int32) Value() (driver.Value, error)

type Int64

type Int64 optionalInt64

func EmptyInt64

func EmptyInt64() Int64

Empty returns an empty optional.

func OfInt64

func OfInt64(value int64) Int64

Of wraps the value in an optional.

func OfInt64Ptr

func OfInt64Ptr(ptr *int64) Int64

func (Int64) Else

func (o Int64) Else(elseValue int64) (value int64)

Else returns the value wrapped by this optional, or the value passed in if there is no value wrapped by this optional.

func (Int64) ElseFunc

func (o Int64) ElseFunc(f func() int64) (value int64)

func (Int64) Get

func (o Int64) Get() (value int64, ok bool)

Get returns the value wrapped by this optional, and an ok signal for whether a value was wrapped.

func (Int64) GormDataType

func (c Int64) GormDataType() string

func (Int64) If

func (o Int64) If(f func(value int64))

If calls the function if there is a value wrapped by this optional.

func (Int64) IsBlank

func (o Int64) IsBlank() bool

func (Int64) IsNil

func (o Int64) IsNil() bool

func (Int64) IsPresent

func (o Int64) IsPresent() bool

func (Int64) MarshalJSON

func (o Int64) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the value being wrapped to JSON. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Int64) MarshalText

func (o *Int64) MarshalText() ([]byte, error)

func (Int64) MarshalXML

func (o Int64) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the value being wrapped to XML. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Int64) Scan

func (c *Int64) Scan(input interface{}) (err error)

func (Int64) String

func (o Int64) String() string

String returns the string representation of the wrapped value, or the string representation of the zero value of the type wrapped if there is no value wrapped by this optional.

func (*Int64) UnmarshalJSON

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

UnmarshalJSON unmarshals the JSON into a value wrapped by this optional.

func (*Int64) UnmarshalText

func (o *Int64) UnmarshalText(data []byte) error

func (*Int64) UnmarshalXML

func (o *Int64) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the XML into a value wrapped by this optional.

func (Int64) V

func (o Int64) V() (value int64)

V returns the value wrapped by this optional, or the zero value of the type wrapped if there is no value wrapped by this optional.

func (Int64) Value

func (c Int64) Value() (driver.Value, error)

type Int8

type Int8 optionalInt8

func EmptyInt8

func EmptyInt8() Int8

Empty returns an empty optional.

func OfInt8

func OfInt8(value int8) Int8

Of wraps the value in an optional.

func OfInt8Ptr

func OfInt8Ptr(ptr *int8) Int8

func (Int8) Else

func (o Int8) Else(elseValue int8) (value int8)

Else returns the value wrapped by this optional, or the value passed in if there is no value wrapped by this optional.

func (Int8) ElseFunc

func (o Int8) ElseFunc(f func() int8) (value int8)

func (Int8) Get

func (o Int8) Get() (value int8, ok bool)

Get returns the value wrapped by this optional, and an ok signal for whether a value was wrapped.

func (Int8) GormDataType

func (c Int8) GormDataType() string

func (Int8) If

func (o Int8) If(f func(value int8))

If calls the function if there is a value wrapped by this optional.

func (Int8) IsBlank

func (o Int8) IsBlank() bool

func (Int8) IsNil

func (o Int8) IsNil() bool

func (Int8) IsPresent

func (o Int8) IsPresent() bool

func (Int8) MarshalJSON

func (o Int8) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the value being wrapped to JSON. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Int8) MarshalText

func (o *Int8) MarshalText() ([]byte, error)

func (Int8) MarshalXML

func (o Int8) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the value being wrapped to XML. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Int8) Scan

func (c *Int8) Scan(input interface{}) (err error)

func (Int8) String

func (o Int8) String() string

String returns the string representation of the wrapped value, or the string representation of the zero value of the type wrapped if there is no value wrapped by this optional.

func (*Int8) UnmarshalJSON

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

UnmarshalJSON unmarshals the JSON into a value wrapped by this optional.

func (*Int8) UnmarshalText

func (o *Int8) UnmarshalText(data []byte) error

func (*Int8) UnmarshalXML

func (o *Int8) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the XML into a value wrapped by this optional.

func (Int8) V

func (o Int8) V() (value int8)

V returns the value wrapped by this optional, or the zero value of the type wrapped if there is no value wrapped by this optional.

func (Int8) Value

func (c Int8) Value() (driver.Value, error)

type String

type String optionalString

func EmptyString

func EmptyString() String

Empty returns an empty optional.

func OfString

func OfString(value string) String

Of wraps the value in an optional.

func OfStringPtr

func OfStringPtr(ptr *string) String

func (String) Else

func (o String) Else(elseValue string) (value string)

Else returns the value wrapped by this optional, or the value passed in if there is no value wrapped by this optional.

func (String) ElseFunc

func (o String) ElseFunc(f func() string) (value string)

func (String) Get

func (o String) Get() (value string, ok bool)

Get returns the value wrapped by this optional, and an ok signal for whether a value was wrapped.

func (String) GormDataType

func (c String) GormDataType() string

func (String) If

func (o String) If(f func(value string))

If calls the function if there is a value wrapped by this optional.

func (String) IsBlank

func (o String) IsBlank() bool

func (String) IsNil

func (o String) IsNil() bool

func (String) IsPresent

func (o String) IsPresent() bool

func (String) MarshalJSON

func (o String) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the value being wrapped to JSON. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*String) MarshalText

func (o *String) MarshalText() ([]byte, error)

func (String) MarshalXML

func (o String) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the value being wrapped to XML. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*String) Scan

func (c *String) Scan(input interface{}) (err error)

func (String) String

func (o String) String() string

String returns the string representation of the wrapped value, or the string representation of the zero value of the type wrapped if there is no value wrapped by this optional.

func (*String) UnmarshalJSON

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

UnmarshalJSON unmarshals the JSON into a value wrapped by this optional.

func (*String) UnmarshalText

func (o *String) UnmarshalText(data []byte) error

func (*String) UnmarshalXML

func (o *String) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the XML into a value wrapped by this optional.

func (String) V

func (o String) V() (value string)

V returns the value wrapped by this optional, or the zero value of the type wrapped if there is no value wrapped by this optional.

func (String) Value

func (c String) Value() (driver.Value, error)

type Uint

type Uint optionalUint

func EmptyUint

func EmptyUint() Uint

Empty returns an empty optional.

func OfUint

func OfUint(value uint) Uint

Of wraps the value in an optional.

func OfUintPtr

func OfUintPtr(ptr *uint) Uint

func (Uint) Else

func (o Uint) Else(elseValue uint) (value uint)

Else returns the value wrapped by this optional, or the value passed in if there is no value wrapped by this optional.

func (Uint) ElseFunc

func (o Uint) ElseFunc(f func() uint) (value uint)

func (Uint) Get

func (o Uint) Get() (value uint, ok bool)

Get returns the value wrapped by this optional, and an ok signal for whether a value was wrapped.

func (Uint) GormDataType

func (c Uint) GormDataType() string

func (Uint) If

func (o Uint) If(f func(value uint))

If calls the function if there is a value wrapped by this optional.

func (Uint) IsBlank

func (o Uint) IsBlank() bool

func (Uint) IsNil

func (o Uint) IsNil() bool

func (Uint) IsPresent

func (o Uint) IsPresent() bool

func (Uint) MarshalJSON

func (o Uint) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the value being wrapped to JSON. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Uint) MarshalText

func (o *Uint) MarshalText() ([]byte, error)

func (Uint) MarshalXML

func (o Uint) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the value being wrapped to XML. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Uint) Scan

func (c *Uint) Scan(input interface{}) (err error)

func (Uint) String

func (o Uint) String() string

String returns the string representation of the wrapped value, or the string representation of the zero value of the type wrapped if there is no value wrapped by this optional.

func (*Uint) UnmarshalJSON

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

UnmarshalJSON unmarshals the JSON into a value wrapped by this optional.

func (*Uint) UnmarshalText

func (o *Uint) UnmarshalText(data []byte) error

func (*Uint) UnmarshalXML

func (o *Uint) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the XML into a value wrapped by this optional.

func (Uint) V

func (o Uint) V() (value uint)

V returns the value wrapped by this optional, or the zero value of the type wrapped if there is no value wrapped by this optional.

func (Uint) Value

func (c Uint) Value() (driver.Value, error)

type Uint16

type Uint16 optionalUint16

func EmptyUint16

func EmptyUint16() Uint16

Empty returns an empty optional.

func OfUint16

func OfUint16(value uint16) Uint16

Of wraps the value in an optional.

func OfUint16Ptr

func OfUint16Ptr(ptr *uint16) Uint16

func (Uint16) Else

func (o Uint16) Else(elseValue uint16) (value uint16)

Else returns the value wrapped by this optional, or the value passed in if there is no value wrapped by this optional.

func (Uint16) ElseFunc

func (o Uint16) ElseFunc(f func() uint16) (value uint16)

func (Uint16) Get

func (o Uint16) Get() (value uint16, ok bool)

Get returns the value wrapped by this optional, and an ok signal for whether a value was wrapped.

func (Uint16) GormDataType

func (c Uint16) GormDataType() string

func (Uint16) If

func (o Uint16) If(f func(value uint16))

If calls the function if there is a value wrapped by this optional.

func (Uint16) IsBlank

func (o Uint16) IsBlank() bool

func (Uint16) IsNil

func (o Uint16) IsNil() bool

func (Uint16) IsPresent

func (o Uint16) IsPresent() bool

func (Uint16) MarshalJSON

func (o Uint16) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the value being wrapped to JSON. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Uint16) MarshalText

func (o *Uint16) MarshalText() ([]byte, error)

func (Uint16) MarshalXML

func (o Uint16) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the value being wrapped to XML. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Uint16) Scan

func (c *Uint16) Scan(input interface{}) (err error)

func (Uint16) String

func (o Uint16) String() string

String returns the string representation of the wrapped value, or the string representation of the zero value of the type wrapped if there is no value wrapped by this optional.

func (*Uint16) UnmarshalJSON

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

UnmarshalJSON unmarshals the JSON into a value wrapped by this optional.

func (*Uint16) UnmarshalText

func (o *Uint16) UnmarshalText(data []byte) error

func (*Uint16) UnmarshalXML

func (o *Uint16) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the XML into a value wrapped by this optional.

func (Uint16) V

func (o Uint16) V() (value uint16)

V returns the value wrapped by this optional, or the zero value of the type wrapped if there is no value wrapped by this optional.

func (Uint16) Value

func (c Uint16) Value() (driver.Value, error)

type Uint32

type Uint32 optionalUint32

func EmptyUint32

func EmptyUint32() Uint32

Empty returns an empty optional.

func OfUint32

func OfUint32(value uint32) Uint32

Of wraps the value in an optional.

func OfUint32Ptr

func OfUint32Ptr(ptr *uint32) Uint32

func (Uint32) Else

func (o Uint32) Else(elseValue uint32) (value uint32)

Else returns the value wrapped by this optional, or the value passed in if there is no value wrapped by this optional.

func (Uint32) ElseFunc

func (o Uint32) ElseFunc(f func() uint32) (value uint32)

func (Uint32) Get

func (o Uint32) Get() (value uint32, ok bool)

Get returns the value wrapped by this optional, and an ok signal for whether a value was wrapped.

func (Uint32) GormDataType

func (c Uint32) GormDataType() string

func (Uint32) If

func (o Uint32) If(f func(value uint32))

If calls the function if there is a value wrapped by this optional.

func (Uint32) IsBlank

func (o Uint32) IsBlank() bool

func (Uint32) IsNil

func (o Uint32) IsNil() bool

func (Uint32) IsPresent

func (o Uint32) IsPresent() bool

func (Uint32) MarshalJSON

func (o Uint32) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the value being wrapped to JSON. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Uint32) MarshalText

func (o *Uint32) MarshalText() ([]byte, error)

func (Uint32) MarshalXML

func (o Uint32) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the value being wrapped to XML. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Uint32) Scan

func (c *Uint32) Scan(input interface{}) (err error)

func (Uint32) String

func (o Uint32) String() string

String returns the string representation of the wrapped value, or the string representation of the zero value of the type wrapped if there is no value wrapped by this optional.

func (*Uint32) UnmarshalJSON

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

UnmarshalJSON unmarshals the JSON into a value wrapped by this optional.

func (*Uint32) UnmarshalText

func (o *Uint32) UnmarshalText(data []byte) error

func (*Uint32) UnmarshalXML

func (o *Uint32) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the XML into a value wrapped by this optional.

func (Uint32) V

func (o Uint32) V() (value uint32)

V returns the value wrapped by this optional, or the zero value of the type wrapped if there is no value wrapped by this optional.

func (Uint32) Value

func (c Uint32) Value() (driver.Value, error)

type Uint64

type Uint64 optionalUint64

func EmptyUint64

func EmptyUint64() Uint64

Empty returns an empty optional.

func OfUint64

func OfUint64(value uint64) Uint64

Of wraps the value in an optional.

func OfUint64Ptr

func OfUint64Ptr(ptr *uint64) Uint64

func (Uint64) Else

func (o Uint64) Else(elseValue uint64) (value uint64)

Else returns the value wrapped by this optional, or the value passed in if there is no value wrapped by this optional.

func (Uint64) ElseFunc

func (o Uint64) ElseFunc(f func() uint64) (value uint64)

func (Uint64) Get

func (o Uint64) Get() (value uint64, ok bool)

Get returns the value wrapped by this optional, and an ok signal for whether a value was wrapped.

func (Uint64) GormDataType

func (c Uint64) GormDataType() string

func (Uint64) If

func (o Uint64) If(f func(value uint64))

If calls the function if there is a value wrapped by this optional.

func (Uint64) IsBlank

func (o Uint64) IsBlank() bool

func (Uint64) IsNil

func (o Uint64) IsNil() bool

func (Uint64) IsPresent

func (o Uint64) IsPresent() bool

func (Uint64) MarshalJSON

func (o Uint64) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the value being wrapped to JSON. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Uint64) MarshalText

func (o *Uint64) MarshalText() ([]byte, error)

func (Uint64) MarshalXML

func (o Uint64) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the value being wrapped to XML. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Uint64) Scan

func (c *Uint64) Scan(input interface{}) (err error)

func (Uint64) String

func (o Uint64) String() string

String returns the string representation of the wrapped value, or the string representation of the zero value of the type wrapped if there is no value wrapped by this optional.

func (*Uint64) UnmarshalJSON

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

UnmarshalJSON unmarshals the JSON into a value wrapped by this optional.

func (*Uint64) UnmarshalText

func (o *Uint64) UnmarshalText(data []byte) error

func (*Uint64) UnmarshalXML

func (o *Uint64) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the XML into a value wrapped by this optional.

func (Uint64) V

func (o Uint64) V() (value uint64)

V returns the value wrapped by this optional, or the zero value of the type wrapped if there is no value wrapped by this optional.

func (Uint64) Value

func (c Uint64) Value() (driver.Value, error)

type Uint8

type Uint8 optionalUint8

func EmptyUint8

func EmptyUint8() Uint8

Empty returns an empty optional.

func OfUint8

func OfUint8(value uint8) Uint8

Of wraps the value in an optional.

func OfUint8Ptr

func OfUint8Ptr(ptr *uint8) Uint8

func (Uint8) Else

func (o Uint8) Else(elseValue uint8) (value uint8)

Else returns the value wrapped by this optional, or the value passed in if there is no value wrapped by this optional.

func (Uint8) ElseFunc

func (o Uint8) ElseFunc(f func() uint8) (value uint8)

func (Uint8) Get

func (o Uint8) Get() (value uint8, ok bool)

Get returns the value wrapped by this optional, and an ok signal for whether a value was wrapped.

func (Uint8) GormDataType

func (c Uint8) GormDataType() string

func (Uint8) If

func (o Uint8) If(f func(value uint8))

If calls the function if there is a value wrapped by this optional.

func (Uint8) IsBlank

func (o Uint8) IsBlank() bool

func (Uint8) IsNil

func (o Uint8) IsNil() bool

func (Uint8) IsPresent

func (o Uint8) IsPresent() bool

func (Uint8) MarshalJSON

func (o Uint8) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the value being wrapped to JSON. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Uint8) MarshalText

func (o *Uint8) MarshalText() ([]byte, error)

func (Uint8) MarshalXML

func (o Uint8) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the value being wrapped to XML. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Uint8) Scan

func (c *Uint8) Scan(input interface{}) (err error)

func (Uint8) String

func (o Uint8) String() string

String returns the string representation of the wrapped value, or the string representation of the zero value of the type wrapped if there is no value wrapped by this optional.

func (*Uint8) UnmarshalJSON

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

UnmarshalJSON unmarshals the JSON into a value wrapped by this optional.

func (*Uint8) UnmarshalText

func (o *Uint8) UnmarshalText(data []byte) error

func (*Uint8) UnmarshalXML

func (o *Uint8) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the XML into a value wrapped by this optional.

func (Uint8) V

func (o Uint8) V() (value uint8)

V returns the value wrapped by this optional, or the zero value of the type wrapped if there is no value wrapped by this optional.

func (Uint8) Value

func (c Uint8) Value() (driver.Value, error)

type Uintptr

type Uintptr optionalUintptr

func EmptyUintptr

func EmptyUintptr() Uintptr

Empty returns an empty optional.

func OfUintptr

func OfUintptr(value uintptr) Uintptr

Of wraps the value in an optional.

func OfUintptrPtr

func OfUintptrPtr(ptr *uintptr) Uintptr

func (Uintptr) Else

func (o Uintptr) Else(elseValue uintptr) (value uintptr)

Else returns the value wrapped by this optional, or the value passed in if there is no value wrapped by this optional.

func (Uintptr) ElseFunc

func (o Uintptr) ElseFunc(f func() uintptr) (value uintptr)

func (Uintptr) Get

func (o Uintptr) Get() (value uintptr, ok bool)

Get returns the value wrapped by this optional, and an ok signal for whether a value was wrapped.

func (Uintptr) GormDataType

func (c Uintptr) GormDataType() string

func (Uintptr) If

func (o Uintptr) If(f func(value uintptr))

If calls the function if there is a value wrapped by this optional.

func (Uintptr) IsBlank

func (o Uintptr) IsBlank() bool

func (Uintptr) IsNil

func (o Uintptr) IsNil() bool

func (Uintptr) IsPresent

func (o Uintptr) IsPresent() bool

func (Uintptr) MarshalJSON

func (o Uintptr) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the value being wrapped to JSON. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Uintptr) MarshalText

func (o *Uintptr) MarshalText() ([]byte, error)

func (Uintptr) MarshalXML

func (o Uintptr) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the value being wrapped to XML. If there is no vale being wrapped, the zero value of its type is marshaled.

func (*Uintptr) Scan

func (c *Uintptr) Scan(input interface{}) (err error)

func (Uintptr) String

func (o Uintptr) String() string

String returns the string representation of the wrapped value, or the string representation of the zero value of the type wrapped if there is no value wrapped by this optional.

func (*Uintptr) UnmarshalJSON

func (o *Uintptr) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the JSON into a value wrapped by this optional.

func (*Uintptr) UnmarshalText

func (o *Uintptr) UnmarshalText(data []byte) error

func (*Uintptr) UnmarshalXML

func (o *Uintptr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the XML into a value wrapped by this optional.

func (Uintptr) V

func (o Uintptr) V() (value uintptr)

V returns the value wrapped by this optional, or the zero value of the type wrapped if there is no value wrapped by this optional.

func (Uintptr) Value

func (c Uintptr) Value() (driver.Value, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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