types

package
v2.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DateOnly

type DateOnly struct {
	Time *time.Time
}

func NewDateOnly added in v2.10.0

func NewDateOnly(t time.Time) *DateOnly

NewDateOnly returns a DateOnly value normalized to midnight UTC.

func (*DateOnly) Add added in v2.8.0

func (d *DateOnly) Add(dur time.Duration) *DateOnly

func (*DateOnly) After added in v2.7.0

func (d *DateOnly) After(other *DateOnly) bool

func (*DateOnly) Before added in v2.7.0

func (d *DateOnly) Before(other *DateOnly) bool

func (*DateOnly) EndOfDay added in v2.9.0

func (d *DateOnly) EndOfDay() time.Time

func (*DateOnly) Equal added in v2.11.0

func (d *DateOnly) Equal(other *DateOnly) bool

func (*DateOnly) IsZero added in v2.7.0

func (d *DateOnly) IsZero() bool

func (*DateOnly) MarshalJSON

func (d *DateOnly) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface and will be called automatically

func (*DateOnly) Scan

func (d *DateOnly) Scan(value interface{}) error

Scan implements the sql.Scanner interface and will be called automatically

func (*DateOnly) StartOfDay added in v2.9.0

func (d *DateOnly) StartOfDay() time.Time

func (*DateOnly) String added in v2.11.0

func (d *DateOnly) String() string

func (*DateOnly) ToTime added in v2.7.0

func (d *DateOnly) ToTime() time.Time

func (*DateOnly) UnmarshalJSON

func (d *DateOnly) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Marshaler interface and will be called automatically This method uses a pointer receiver because it modifies the internal state. Using a value receiver would only update a copy, leaving the original unchanged.

func (*DateOnly) Value

func (d *DateOnly) Value() (driver.Value, error)

Value implements the driver.Value interface and will be called automatically

type TimeOnly

type TimeOnly struct {
	Time *time.Time
}

func NewTimeOnly added in v2.13.0

func NewTimeOnly(hour, minute int) *TimeOnly

func (*TimeOnly) After added in v2.13.0

func (t *TimeOnly) After(other *TimeOnly) bool

func (*TimeOnly) Before added in v2.13.0

func (t *TimeOnly) Before(other *TimeOnly) bool

func (*TimeOnly) Equal added in v2.13.0

func (t *TimeOnly) Equal(other *TimeOnly) bool

func (*TimeOnly) IsZero added in v2.13.0

func (t *TimeOnly) IsZero() bool

func (*TimeOnly) MarshalJSON

func (t *TimeOnly) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface and will be called automatically

func (*TimeOnly) Scan

func (t *TimeOnly) Scan(value interface{}) error

Scan implements the sql.Scanner interface and will be called automatically

func (*TimeOnly) String added in v2.13.0

func (t *TimeOnly) String() string

func (*TimeOnly) UnmarshalJSON

func (t *TimeOnly) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Marshaler interface and will be called automatically This method uses a pointer receiver because it modifies the internal state. Using a value receiver would only update a copy, leaving the original unchanged.

func (*TimeOnly) Value

func (t *TimeOnly) Value() (driver.Value, error)

Value implements the driver.Value interface and will be called automatically

Jump to

Keyboard shortcuts

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