time

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

README

time

项目简介

Kratos的时间模块,主要用于mysql时间戳转换、配置文件读取并转换、Context超时时间比较

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration xtime.Duration

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

func (Duration) Shrink

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.

Jump to

Keyboard shortcuts

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