chainlink: github.com/smartcontractkit/chainlink/core/null Index | Files

package null

import "github.com/smartcontractkit/chainlink/core/null"

Index

Package Files

uint32.go

type Uint32 Uses

type Uint32 struct {
    Uint32 uint32
    Valid  bool
}

Uint32 encapsulates the value and validity (not null) of a uint32 value, to differentiate nil from 0 in json and sql.

func NewUint32 Uses

func NewUint32(i uint32, valid bool) Uint32

NewUint32 returns an instance of Uint32 with the passed parameters.

func Uint32From Uses

func Uint32From(i uint32) Uint32

Uint32From creates a new Uint32 that will always be valid.

func (Uint32) MarshalJSON Uses

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

MarshalJSON implements json.Marshaler. It will encode null if this Uint32 is null.

func (Uint32) MarshalText Uses

func (i Uint32) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler. It will encode a blank string if this Uint32 is null.

func (*Uint32) Scan Uses

func (i *Uint32) Scan(value interface{}) error

Scan reads the database value and returns an instance.

func (*Uint32) SetValid Uses

func (i *Uint32) SetValid(n uint32)

SetValid changes this Uint32's value and also sets it to be non-null.

func (*Uint32) UnmarshalJSON Uses

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

UnmarshalJSON implements json.Unmarshaler. It supports number and null input. 0 will not be considered a null Int.

func (*Uint32) UnmarshalText Uses

func (i *Uint32) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler. It will unmarshal to a null Uint32 if the input is a blank or not an integer. It will return an error if the input is not an integer, blank, or "null".

func (Uint32) Value Uses

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

Value returns this instance serialized for database storage.

Package null imports 5 packages (graph). Updated 2019-06-27. Refresh now. Tools for package owners.