ekatime

package
v2.8.15 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MONTH_JANUARY   = ekatime_orig.MONTH_JANUARY
	MONTH_FEBRUARY  = ekatime_orig.MONTH_FEBRUARY
	MONTH_MARCH     = ekatime_orig.MONTH_MARCH
	MONTH_APRIL     = ekatime_orig.MONTH_APRIL
	MONTH_MAY       = ekatime_orig.MONTH_MAY
	MONTH_JUNE      = ekatime_orig.MONTH_JUNE
	MONTH_JULY      = ekatime_orig.MONTH_JULY
	MONTH_AUGUST    = ekatime_orig.MONTH_AUGUST
	MONTH_SEPTEMBER = ekatime_orig.MONTH_SEPTEMBER
	MONTH_OCTOBER   = ekatime_orig.MONTH_OCTOBER
	MONTH_NOVEMBER  = ekatime_orig.MONTH_NOVEMBER
	MONTH_DECEMBER  = ekatime_orig.MONTH_DECEMBER

	WEEKDAY_WEDNESDAY = ekatime_orig.WEEKDAY_WEDNESDAY
	WEEKDAY_THURSDAY  = ekatime_orig.WEEKDAY_THURSDAY
	WEEKDAY_FRIDAY    = ekatime_orig.WEEKDAY_FRIDAY
	WEEKDAY_SATURDAY  = ekatime_orig.WEEKDAY_SATURDAY
	WEEKDAY_SUNDAY    = ekatime_orig.WEEKDAY_SUNDAY
	WEEKDAY_MONDAY    = ekatime_orig.WEEKDAY_MONDAY
	WEEKDAY_TUESDAY   = ekatime_orig.WEEKDAY_TUESDAY

	SECONDS_IN_MINUTE   = ekatime_orig.SECONDS_IN_MINUTE
	SECONDS_IN_HOUR     = ekatime_orig.SECONDS_IN_HOUR
	SECONDS_IN_12H      = ekatime_orig.SECONDS_IN_12H
	SECONDS_IN_DAY      = ekatime_orig.SECONDS_IN_DAY
	SECONDS_IN_WEEK     = ekatime_orig.SECONDS_IN_WEEK
	SECONDS_IN_365_YEAR = ekatime_orig.SECONDS_IN_365_YEAR
	SECONDS_IN_366_YEAR = ekatime_orig.SECONDS_IN_366_YEAR
)

noinspection GoSnakeCaseUsage,GoUnusedConst

Variables

View Source
var (
	IsValidDate = ekatime_orig.IsValidDate
	IsLeap      = ekatime_orig.IsLeap

	NewEvent = ekatime_orig.NewEvent

	TillNextMinute   = ekatime_orig.TillNextMinute
	TillNextHour     = ekatime_orig.TillNextHour
	TillNextNoon     = ekatime_orig.TillNextNoon
	TillNextMidnight = ekatime_orig.TillNextMidnight
	TillNextDay      = ekatime_orig.TillNextDay
	TillNextMonth    = ekatime_orig.TillNextMonth
	TillNextYear     = ekatime_orig.TillNextYear

	IsValidTime = ekatime_orig.IsValidTime
)

Functions

This section is empty.

Types

type Calendar

type Calendar = ekatime_orig.Calendar

type Date

type Date OriginalDate

Date is the same as ekatime.Date but with supporting go-pg (v10).

Read more: https://github.com/qioalice/ekago/ekatime/date_encode.go , https://github.com/go-pg/pg , https://github.com/go-pg/pg/blob/v10/example_custom_test.go .

func NewDate

func NewDate(y Year, m Month, d Day) Date

func WrapDate

func WrapDate(dd OriginalDate) Date

WrapDate returns an Date object as modified ekatime.Date object for being able to use it with go-pg.

See also: WrapDatePtr().

func WrapDatePtr added in v2.8.5

func WrapDatePtr(dd *OriginalDate) *Date

WrapDatePtr returns a Date object by ptr as modified ekatime.Date object for being able to use it with go-pg.

See also: WrapDate().

func (Date) AppendTo added in v2.8.5

func (dd Date) AppendTo(b []byte, separator byte) []byte

func (Date) AppendValue

func (dd Date) AppendValue(b []byte, flags int) ([]byte, error)

func (Date) Day added in v2.8.5

func (dd Date) Day() Day

func (Date) DaysInMonth added in v2.8.5

func (dd Date) DaysInMonth() Day

func (*Date) DecodeBinary added in v2.8.15

func (dd *Date) DecodeBinary(_ *pgtype.ConnInfo, src []byte) error

DecodeBinary

From https://github.com/jackc/pgtype@v1.7.0/pgtype.go :

DecodeBinary decodes src into BinaryDecoder. If src is nil then the
original SQL value is NULL. BinaryDecoder takes ownership of src. The
caller MUST not use it again.

func (Date) EncodeBinary added in v2.8.15

func (dd Date) EncodeBinary(_ *pgtype.ConnInfo, buf []byte) (newBuf []byte, err error)

EncodeBinary

From https://github.com/jackc/pgtype@v1.7.0/pgtype.go :

EncodeBinary should append the binary format of self to buf. If self is the
SQL value NULL then append nothing and return (nil, nil). The caller of
EncodeBinary is responsible for writing the correct NULL value or the
length of the data written.

func (Date) Equal added in v2.8.5

func (dd Date) Equal(other Date) bool

func (*Date) MarshalJSON added in v2.8.5

func (dd *Date) MarshalJSON() ([]byte, error)

func (Date) Month added in v2.8.5

func (dd Date) Month() Month

func (*Date) ParseFrom added in v2.8.5

func (dd *Date) ParseFrom(b []byte) error

func (*Date) ScanValue

func (dd *Date) ScanValue(rd types.Reader, n int) error

func (Date) Split added in v2.8.5

func (dd Date) Split() (y Year, m Month, d Day)

func (Date) String added in v2.8.5

func (dd Date) String() string

func (Date) ToCmp added in v2.8.5

func (dd Date) ToCmp() Date

func (Date) ToOrig added in v2.8.5

func (dd Date) ToOrig() OriginalDate

func (*Date) ToOrigPtr added in v2.8.5

func (dd *Date) ToOrigPtr() *OriginalDate

func (*Date) UnmarshalJSON added in v2.8.5

func (dd *Date) UnmarshalJSON(b []byte) error

func (Date) Weekday added in v2.8.5

func (dd Date) Weekday() Weekday

func (Date) WithTime added in v2.8.5

func (dd Date) WithTime(hh Hour, mm Minute, ss Second) Timestamp

func (Date) Year added in v2.8.5

func (dd Date) Year() Year

type Day

type Day = ekatime_orig.Day

type Event

type Event = ekatime_orig.Event

type Hour

type Hour = ekatime_orig.Hour

type Minute

type Minute = ekatime_orig.Minute

type Month

type Month = ekatime_orig.Month

type OriginalDate added in v2.8.11

type OriginalDate = ekatime_orig.Date

type OriginalTime added in v2.8.11

type OriginalTime = ekatime_orig.Time

type OriginalTimestamp added in v2.8.11

type OriginalTimestamp = ekatime_orig.Timestamp

type OriginalTimestampPair added in v2.8.11

type OriginalTimestampPair = ekatime_orig.TimestampPair

type Second

type Second = ekatime_orig.Second

type Time

type Time OriginalTime

Time is the same as ekatime.Time but with supporting go-pg (v10).

Read more: https://github.com/qioalice/ekago/ekatime/time_encode.go , https://github.com/go-pg/pg , https://github.com/go-pg/pg/blob/v10/example_custom_test.go .

func NewTime

func NewTime(h Hour, m Minute, s Second) Time

func WrapTime

func WrapTime(t OriginalTime) Time

WrapDate returns a Time object as modified ekatime.Time object for being able to use it with go-pg.

See also: WrapDateUnsafe().

func WrapTimePtr added in v2.8.5

func WrapTimePtr(t *OriginalTime) *Time

WrapTimePtr returns a Time object by ptr as modified ekatime.Time object for being able to use it with go-pg.

See also: WrapTime().

func (Time) AppendTo added in v2.8.5

func (t Time) AppendTo(b []byte, separator byte) []byte

func (Time) AppendValue

func (t Time) AppendValue(b []byte, flags int) ([]byte, error)

func (*Time) DecodeBinary added in v2.8.15

func (t *Time) DecodeBinary(_ *pgtype.ConnInfo, src []byte) error

DecodeBinary

From https://github.com/jackc/pgtype@v1.7.0/pgtype.go :

DecodeBinary decodes src into BinaryDecoder. If src is nil then the
original SQL value is NULL. BinaryDecoder takes ownership of src. The
caller MUST not use it again.

func (Time) EncodeBinary added in v2.8.15

func (t Time) EncodeBinary(_ *pgtype.ConnInfo, buf []byte) (newBuf []byte, err error)

EncodeBinary

From https://github.com/jackc/pgtype@v1.7.0/pgtype.go :

EncodeBinary should append the binary format of self to buf. If self is the
SQL value NULL then append nothing and return (nil, nil). The caller of
EncodeBinary is responsible for writing the correct NULL value or the
length of the data written.

func (Time) Hour added in v2.8.5

func (t Time) Hour() Hour

func (*Time) MarshalJSON added in v2.8.5

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

func (Time) Minute added in v2.8.5

func (t Time) Minute() Minute

func (*Time) ParseFrom added in v2.8.5

func (t *Time) ParseFrom(b []byte) error

func (*Time) ScanValue

func (t *Time) ScanValue(rd types.Reader, n int) error

func (Time) Second added in v2.8.5

func (t Time) Second() Second

func (Time) Split added in v2.8.5

func (t Time) Split() (h Hour, m Minute, s Second)

func (Time) String added in v2.8.5

func (t Time) String() string

func (Time) ToOrig added in v2.8.5

func (t Time) ToOrig() OriginalTime

func (*Time) ToOrigPtr added in v2.8.5

func (t *Time) ToOrigPtr() *OriginalTime

func (*Time) UnmarshalJSON added in v2.8.5

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

func (Time) WithDate added in v2.8.5

func (t Time) WithDate(y Year, m Month, d Day) Timestamp

type Timestamp

type Timestamp OriginalTimestamp

Timestamp is the same as ekatime.Timestamp but with supporting go-pg (v10).

Read more: https://github.com/qioalice/ekago/ekatime/timestamp_encode.go , https://github.com/go-pg/pg , https://github.com/go-pg/pg/blob/v10/example_custom_test.go .

func BeginningOfMonth

func BeginningOfMonth(y Year, m Month) Timestamp

func BeginningOfYear

func BeginningOfYear(y Year) Timestamp

func EndOfMonth

func EndOfMonth(y Year, m Month) Timestamp

func EndOfYear

func EndOfYear(y Year) Timestamp

func InMonth

func InMonth(y Year, m Month) Timestamp

func InYear

func InYear(y Year) Timestamp

func Now

func Now() Timestamp

func UnixFrom

func UnixFrom(y Year, m Month, d Day, hh Hour, mm Minute, ss Second) Timestamp

func UnixFromStd

func UnixFromStd(t time.Time) Timestamp

func WrapTimestamp

func WrapTimestamp(ts OriginalTimestamp) Timestamp

WrapTimestamp returns a Timestamp object as modified ekatime.Timestamp object for being able to use it with go-pg.

See also: WrapTimestampPtr().

func WrapTimestampPtr added in v2.8.5

func WrapTimestampPtr(ts *OriginalTimestamp) *Timestamp

WrapTimestampPtr returns a Timestamp object by ptr as modified ekatime.Time object for being able to use it with go-pg.

See also: WrapTimestamp().

func (Timestamp) AppendTo added in v2.8.5

func (ts Timestamp) AppendTo(b []byte, separatorDate, separatorTime byte) []byte

func (Timestamp) AppendValue

func (ts Timestamp) AppendValue(b []byte, flags int) ([]byte, error)

func (Timestamp) BeginningAndEndOfDay added in v2.8.5

func (ts Timestamp) BeginningAndEndOfDay() TimestampPair

func (Timestamp) BeginningAndEndOfMonth added in v2.8.5

func (ts Timestamp) BeginningAndEndOfMonth() TimestampPair

func (Timestamp) BeginningAndEndOfYear added in v2.8.5

func (ts Timestamp) BeginningAndEndOfYear() TimestampPair

func (Timestamp) BeginningOfDay added in v2.8.5

func (ts Timestamp) BeginningOfDay() Timestamp

func (Timestamp) BeginningOfMonth added in v2.8.5

func (ts Timestamp) BeginningOfMonth() Timestamp

func (Timestamp) BeginningOfYear added in v2.8.5

func (ts Timestamp) BeginningOfYear() Timestamp

func (Timestamp) Date added in v2.8.5

func (ts Timestamp) Date() Date

func (Timestamp) Day added in v2.8.5

func (ts Timestamp) Day() Day

func (*Timestamp) DecodeBinary added in v2.8.15

func (ts *Timestamp) DecodeBinary(_ *pgtype.ConnInfo, src []byte) error

DecodeBinary

From https://github.com/jackc/pgtype@v1.7.0/pgtype.go :

DecodeBinary decodes src into BinaryDecoder. If src is nil then the
original SQL value is NULL. BinaryDecoder takes ownership of src. The
caller MUST not use it again.

func (Timestamp) EncodeBinary added in v2.8.15

func (ts Timestamp) EncodeBinary(_ *pgtype.ConnInfo, buf []byte) (newBuf []byte, err error)

EncodeBinary

From https://github.com/jackc/pgtype@v1.7.0/pgtype.go :

EncodeBinary should append the binary format of self to buf. If self is the
SQL value NULL then append nothing and return (nil, nil). The caller of
EncodeBinary is responsible for writing the correct NULL value or the
length of the data written.

func (Timestamp) EndOfDay added in v2.8.5

func (ts Timestamp) EndOfDay() Timestamp

func (Timestamp) EndOfMonth added in v2.8.5

func (ts Timestamp) EndOfMonth() Timestamp

func (Timestamp) EndOfYear added in v2.8.5

func (ts Timestamp) EndOfYear() Timestamp

func (Timestamp) Hour added in v2.8.5

func (ts Timestamp) Hour() Hour

func (Timestamp) I64 added in v2.8.5

func (ts Timestamp) I64() int64

func (*Timestamp) MarshalJSON added in v2.8.5

func (ts *Timestamp) MarshalJSON() ([]byte, error)

func (Timestamp) Minute added in v2.8.5

func (ts Timestamp) Minute() Minute

func (Timestamp) Month added in v2.8.5

func (ts Timestamp) Month() Month

func (*Timestamp) ParseFrom added in v2.8.5

func (ts *Timestamp) ParseFrom(b []byte) error

func (*Timestamp) ScanValue

func (ts *Timestamp) ScanValue(rd types.Reader, n int) error

func (Timestamp) Second added in v2.8.5

func (ts Timestamp) Second() Second

func (Timestamp) Split added in v2.8.5

func (ts Timestamp) Split() (d Date, t Time)

func (Timestamp) Std added in v2.8.5

func (ts Timestamp) Std() time.Time

func (Timestamp) String added in v2.8.5

func (ts Timestamp) String() string

func (Timestamp) TillNext12h added in v2.8.5

func (ts Timestamp) TillNext12h() time.Duration

func (Timestamp) TillNextDay added in v2.8.5

func (ts Timestamp) TillNextDay() time.Duration

func (Timestamp) TillNextHour added in v2.8.5

func (ts Timestamp) TillNextHour() time.Duration

func (Timestamp) TillNextMidnight added in v2.8.5

func (ts Timestamp) TillNextMidnight() time.Duration

func (Timestamp) TillNextMinute added in v2.8.5

func (ts Timestamp) TillNextMinute() time.Duration

func (Timestamp) TillNextMonth added in v2.8.5

func (ts Timestamp) TillNextMonth() time.Duration

func (Timestamp) TillNextNoon added in v2.8.5

func (ts Timestamp) TillNextNoon() time.Duration

func (Timestamp) TillNextYear added in v2.8.5

func (ts Timestamp) TillNextYear() time.Duration

func (Timestamp) Time added in v2.8.5

func (ts Timestamp) Time() Time

func (Timestamp) ToOrig added in v2.8.5

func (ts Timestamp) ToOrig() OriginalTimestamp

func (*Timestamp) ToOrigPtr added in v2.8.5

func (ts *Timestamp) ToOrigPtr() *OriginalTimestamp

func (*Timestamp) UnmarshalJSON added in v2.8.5

func (ts *Timestamp) UnmarshalJSON(b []byte) error

func (Timestamp) Year added in v2.8.5

func (ts Timestamp) Year() Year

type TimestampPair

type TimestampPair [2]Timestamp

TimestampPair is the same as ekatime.TimestampPair but with supporting go-pg (v10).

Read more: https://github.com/qioalice/ekago/ekatime/timestamp_encode.go , https://github.com/go-pg/pg , https://github.com/go-pg/pg/blob/v10/example_custom_test.go .

func BeginningAndEndOfMonth

func BeginningAndEndOfMonth(y Year, m Month) TimestampPair

func BeginningAndEndOfYear

func BeginningAndEndOfYear(y Year) TimestampPair

func WrapTimestampPair added in v2.8.5

func WrapTimestampPair(tsp OriginalTimestampPair) TimestampPair

func (TimestampPair) I64 added in v2.8.5

func (tsp TimestampPair) I64() (int64, int64)

func (TimestampPair) Split added in v2.8.5

func (tsp TimestampPair) Split() (t1, t2 Timestamp)

func (TimestampPair) ToOrig added in v2.8.5

func (tsp TimestampPair) ToOrig() OriginalTimestampPair

type Today

type Today = ekatime_orig.Today

type Weekday

type Weekday = ekatime_orig.Weekday

type Year

type Year = ekatime_orig.Year

Jump to

Keyboard shortcuts

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