uuid

package
v0.0.0-...-e652847 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NullUUID

type NullUUID api.UUID

NullUUID is a api.UUID that handles IsZero as a db NULL value, and as an empty string (or null) in (un)marshalText

func FromBytes

func FromBytes(str []byte) (NullUUID, error)

FromBytes initialize a NullUUID from []byte

func FromString

func FromString(str string) (NullUUID, error)

FromString initialize a NullUUID from a string

func MustFromBytes

func MustFromBytes(str []byte) NullUUID

MustFromBytes initialize a NullUUID from a []byte and panics if it cannot

func MustFromString

func MustFromString(str string) NullUUID

MustFromString initialize a NullUUID from a string and panics if it cannot

func (NullUUID) IsNull

func (u NullUUID) IsNull() bool

IsNull returns true if value is Zero

func (NullUUID) IsZero

func (u NullUUID) IsZero() bool

IsZero returns true if value is zero

func (NullUUID) MarshalText

func (u NullUUID) MarshalText() ([]byte, error)

MarshalText returns the stringified UUID, or an empty slice if the value is Null/Zero

func (*NullUUID) ReadBytes

func (u *NullUUID) ReadBytes(str []byte) error

ReadBytes see api.UUID.ReadBytes

func (*NullUUID) Scan

func (u *NullUUID) Scan(val interface{}) error

Scan scans a uuid from the given interface instance.

func (*NullUUID) SetNull

func (u *NullUUID) SetNull()

SetNull reset the value to empty

func (*NullUUID) SetString

func (u *NullUUID) SetString(str string) error

SetString see api.UUID.SetString

func (*NullUUID) SetZero

func (u *NullUUID) SetZero()

SetZero reset the value to empty

func (NullUUID) String

func (u NullUUID) String() string

func (*NullUUID) UnmarshalText

func (u *NullUUID) UnmarshalText(text []byte) error

UnmarshalText returns the stringified UUID, or nil if the value is Null/Zero

func (NullUUID) Value

func (u NullUUID) Value() (driver.Value, error)

Value gives the database driver representation of the UUID.

Jump to

Keyboard shortcuts

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