kratos: github.com/bilibili/kratos/pkg/time Index | Files

package time

import "github.com/bilibili/kratos/pkg/time"

Index

Package Files

time.go

type Duration Uses

type Duration xtime.Duration

Duration be used toml unmarshal string time, like 1s, 500ms.

func (Duration) Shrink Uses

func (d Duration) Shrink(c context.Context) (Duration, context.Context, context.CancelFunc)

Shrink will decrease the duration by comparing with context's timeout duration and return new timeout\context\CancelFunc.

func (*Duration) UnmarshalText Uses

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

UnmarshalText unmarshal text to duration.

type Time Uses

type Time int64

Time be used to MySql timestamp converting.

func (*Time) Scan Uses

func (jt *Time) Scan(src interface{}) (err error)

Scan scan time.

func (Time) Time Uses

func (jt Time) Time() xtime.Time

Time get time.

func (Time) Value Uses

func (jt Time) Value() (driver.Value, error)

Value get time value.

Package time imports 4 packages (graph) and is imported by 12 packages. Updated 2019-05-04. Refresh now. Tools for package owners.