# README
time
import "github.com/ccheers/xpkg/time"
Index
type Duration
Duration be used toml unmarshal string time, like 1s, 500ms.
type Duration xtime.Duration
func (Duration) Shrink
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
func (d *Duration) UnmarshalText(text []byte) error
UnmarshalText unmarshal text to duration.
type Time
Time be used to MySql timestamp converting.
type Time int64
func (*Time) Scan
func (jt *Time) Scan(src interface{}) (err error)
Scan scan time.
func (Time) Time
func (jt Time) Time() xtime.Time
Time get time.
func (Time) Value
func (jt Time) Value() (driver.Value, error)
Value get time value.
Generated by gomarkdoc