nuuid

package
v0.0.0-...-693896e Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 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 NUUID

type NUUID struct {
	UUID  uuid.UUID
	Valid bool
}

NUUID is a nullable UUID, Use it if you want to make UUID nullable in DB/Json model/etc

func From

func From(id uuid.UUID) NUUID

From takes a UUID and returns a NUUID

func FromString

func FromString(str string) NUUID

FromString takes a string and returns a NUUID

func New

func New(id uuid.UUID, valid bool) NUUID

New creates a new NUUID

func (NUUID) IsZero

func (nid NUUID) IsZero() bool

IsZero checks whether the NUUID is null or not

func (NUUID) MarshalJSON

func (nid NUUID) MarshalJSON() ([]byte, error)

MarshalJSON implements the MarshalJSON method

func (NUUID) MarshalText

func (nid NUUID) MarshalText() ([]byte, error)

MarshalText implements the MarshalText method

func (NUUID) Ptr

func (nid NUUID) Ptr() *uuid.UUID

Ptr returns the pointer to a NUUID

func (*NUUID) Scan

func (nid *NUUID) Scan(value interface{}) error

Scan implements the Scanner interface.

func (*NUUID) SetValid

func (nid *NUUID) SetValid(v uuid.UUID)

SetValid sets the value of a NUUID

func (*NUUID) UnmarshalJSON

func (nid *NUUID) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the UnmarshalJSON method

func (*NUUID) UnmarshalText

func (nid *NUUID) UnmarshalText(text []byte) error

UnmarshalText implements the UnmarshalText method

func (NUUID) Value

func (nid NUUID) Value() (driver.Value, error)

Value implements the driver Valuer interface.

Jump to

Keyboard shortcuts

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