Back to godoc.org

Package time

v0.5.0
Latest Go to latest

The latest major version is .

Published: Apr 30, 2020 | License: MIT | Module: github.com/go-kratos/kratos

Index

type Duration

type Duration xtime.Duration

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

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

type Time int64

Time be used to MySql timestamp converting.

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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier