nulls

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Time

type Time struct {
	Time  time.Time
	Valid bool // Valid is true if Time is not NULL
}

Time represents a time.Time that may be null. It implements sql.Scanner and driver.Valuer interfaces.

func NewTime

func NewTime(t time.Time) Time

NewTime returns a new, properly initialized Time object.

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Time) Parse

func (t *Time) Parse(s string) error

Parse tries to parse the string as a time using multiple formats.

func (*Time) Scan

func (t *Time) Scan(value any) error

Scan implements the sql.Scanner interface.

func (Time) String

func (t Time) String() string

String implements fmt.Stringer.

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (Time) Value

func (t Time) 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