typedef

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetTimezone added in v0.1.16

func SetTimezone(timezone string)

SetTimezone sets datetime timezone. If timezone is invalid then the timezone is Local

Types

type Date

type Date struct {
	// contains filtered or unexported fields
}

func DateFromProto added in v0.1.13

func DateFromProto(ts *timestamppb.Timestamp) *Date

func DateToday

func DateToday() Date

func NewDate

func NewDate(value time.Time) Date

func (Date) Err

func (d Date) Err() error

func (Date) IsZero

func (d Date) IsZero() bool

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

MarshalJSON serializes the date to JSON

func (*Date) Scan

func (d *Date) Scan(value any) error

Scan implements sql.Scanner

func (*Date) Set

func (d *Date) Set(val any) error

func (Date) String

func (d Date) String() string

func (Date) Time

func (d Date) Time() time.Time

func (Date) ToProto added in v0.1.13

func (d Date) ToProto() *timestamppb.Timestamp

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(data []byte) error

UnmarshalJSON parses date from JSON string

func (*Date) UnmarshalText

func (d *Date) UnmarshalText(text []byte) error

UnmarshalText parses date from text (e.g., query param)

func (Date) Valid

func (d Date) Valid() bool

func (Date) Validate

func (d Date) Validate() error

func (Date) Value

func (d Date) Value() (driver.Value, error)

Value for sql.Valuer

type Datetime

type Datetime struct {
	// contains filtered or unexported fields
}

func DatetimeFromProto added in v0.1.13

func DatetimeFromProto(ts *timestamppb.Timestamp) *Datetime

func DatetimeNow

func DatetimeNow() Datetime

func NewDatetime

func NewDatetime(value time.Time) Datetime

func (Datetime) Err

func (d Datetime) Err() error

func (Datetime) IsZero

func (d Datetime) IsZero() bool

func (Datetime) MarshalJSON

func (d Datetime) MarshalJSON() ([]byte, error)

MarshalJSON serializes to JSON

func (*Datetime) Scan

func (d *Datetime) Scan(value any) error

Scan implements sql.Scanner

func (*Datetime) Set

func (d *Datetime) Set(val any) error

func (Datetime) String

func (d Datetime) String() string

func (Datetime) Time

func (d Datetime) Time() time.Time

func (Datetime) ToProto added in v0.1.13

func (d Datetime) ToProto() *timestamppb.Timestamp

func (*Datetime) UnmarshalJSON

func (d *Datetime) UnmarshalJSON(data []byte) error

UnmarshalJSON parses from JSON string

func (*Datetime) UnmarshalText

func (d *Datetime) UnmarshalText(text []byte) error

UnmarshalText parses from text (e.g. query param)

func (Datetime) Valid

func (d Datetime) Valid() bool

func (Datetime) Validate

func (d Datetime) Validate() error

func (Datetime) Value

func (d Datetime) Value() (driver.Value, error)

Value for sql.Valuer

type Float

type Float struct {
	// contains filtered or unexported fields
}

func NewFloat

func NewFloat(value float64) Float

func (Float) Err

func (f Float) Err() error

func (Float) Float64

func (f Float) Float64() float64

func (Float) MarshalJSON

func (f Float) MarshalJSON() ([]byte, error)

func (*Float) Scan

func (f *Float) Scan(value any) error

func (*Float) Set

func (f *Float) Set(val any) error

func (Float) String

func (f Float) String() string

func (*Float) UnmarshalJSON

func (f *Float) UnmarshalJSON(data []byte) error

func (*Float) UnmarshalText

func (f *Float) UnmarshalText(text []byte) error

func (Float) Valid

func (f Float) Valid() bool

func (Float) Value

func (f Float) Value() (driver.Value, error)

type Integer

type Integer struct {
	// contains filtered or unexported fields
}

func NewInteger

func NewInteger(value int64) Integer

func (Integer) Err

func (i Integer) Err() error

func (Integer) Int64

func (i Integer) Int64() int64

func (Integer) MarshalJSON

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

func (*Integer) Scan

func (i *Integer) Scan(value any) error

func (*Integer) Set

func (i *Integer) Set(val any) error

func (Integer) String

func (i Integer) String() string

func (*Integer) UnmarshalJSON

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

func (*Integer) UnmarshalText

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

func (Integer) Valid

func (i Integer) Valid() bool

func (Integer) Value

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

type Validatable

type Validatable interface {
	Err() error
}

Jump to

Keyboard shortcuts

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