util

package
v0.0.0-...-41edef4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Date

func Date() (v string)

格式化时间

func Format

func Format(t *time.Time) (v string)

格式化时间

func If

func If(b bool, t, f interface{}) interface{}

模拟三元操作

func JsonDecode

func JsonDecode(s string, out interface{}) error

转JSON

func JsonEncode

func JsonEncode(v interface{}) string

转JSON

func Millisecond

func Millisecond() int64

获取毫秒

func StrToTime

func StrToTime(s string) *time.Time

时间字符串转换成时间对象

func Time

func Time() *time.Time

时间字符串转换成时间对象

Types

type CustomerFormatter

type CustomerFormatter struct {
	Prefix string
}

func (*CustomerFormatter) Format

func (s *CustomerFormatter) Format(entry *logrus.Entry) ([]byte, error)

type NumberDouble

type NumberDouble float64

func (*NumberDouble) MarshalJSON

func (n *NumberDouble) MarshalJSON() ([]byte, error)

func (*NumberDouble) UnmarshalJSON

func (n *NumberDouble) UnmarshalJSON(data []byte) (err error)

type NumberInt

type NumberInt int

func (*NumberInt) MarshalJSON

func (n *NumberInt) MarshalJSON() ([]byte, error)

func (*NumberInt) UnmarshalJSON

func (n *NumberInt) UnmarshalJSON(data []byte) (err error)

type NumberLong

type NumberLong int64

func (*NumberLong) MarshalJSON

func (n *NumberLong) MarshalJSON() ([]byte, error)

func (*NumberLong) UnmarshalJSON

func (n *NumberLong) UnmarshalJSON(data []byte) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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