gkit

package module
v0.0.0-...-a32dd99 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: MIT Imports: 8 Imported by: 0

README

gkit

GitHub License

Documentation

Index

Constants

View Source
const (
	DateFormat     = "2006-01-02"
	TimeFormat     = "15:04:05"
	DateTimeFormat = "2006-01-02 15:04:05"
)

Variables

View Source
var ZeroTime = time.Unix(0, 0)

Functions

func BatchItoa

func BatchItoa(data []int) []string

func CharLength

func CharLength(str string) (count int)

统计字符长度,区分中英文

func CopyIntSlice

func CopyIntSlice(slice []int) []int

func CopyStringSlice

func CopyStringSlice(slice []string) []string

func DayEndTime

func DayEndTime(t time.Time) time.Time

func DayStartTime

func DayStartTime(t time.Time) time.Time

func EqualDay

func EqualDay(a, b time.Time) bool

func FilterDuplicateAndCustomFuncIntSlice

func FilterDuplicateAndCustomFuncIntSlice(slice []int, filter func(i int) bool) []int

func FilterDuplicateAndCustomFuncStringSlice

func FilterDuplicateAndCustomFuncStringSlice(slice []string, filter func(i string) bool) []string

func FilterDuplicateAndEmptyStringSlice

func FilterDuplicateAndEmptyStringSlice(slice []string) []string

func FilterDuplicateAndZeroIntSlice

func FilterDuplicateAndZeroIntSlice(slice []int) []int

func FilterDuplicateIntSlice

func FilterDuplicateIntSlice(slice []int) []int

func FilterDuplicateStringSlice

func FilterDuplicateStringSlice(slice []string) []string

func FormatDate

func FormatDate(t time.Time) string

func FormatDateTime

func FormatDateTime(t time.Time) string

func FormatTime

func FormatTime(t time.Time) string

func GetFirstLetter

func GetFirstLetter(str string) string

获取字符串第一个字的拼音首字母

func GetIds

func GetIds(ig IdGetter) []int

func Int64Slice2IntSlice

func Int64Slice2IntSlice(slice []int64) []int

func IntSlice2Int64Slice

func IntSlice2Int64Slice(slice []int) []int64

func IntSlice2StringSlice

func IntSlice2StringSlice(slice []int) []string

func JoinIds

func JoinIds(ig IdGetter, sep string) string

func MonthFirstDayEndTime

func MonthFirstDayEndTime(t time.Time) time.Time

func MonthFirstDayStartTime

func MonthFirstDayStartTime(t time.Time) time.Time

func MonthLastDayEndTime

func MonthLastDayEndTime(t time.Time) time.Time

func MonthLastDayStartTime

func MonthLastDayStartTime(t time.Time) time.Time

func MustAtoi

func MustAtoi(str string) int

func MustBatchAtoi

func MustBatchAtoi(data []string) []int

func MustMarshal

func MustMarshal(v interface{}) []byte

func MustMarshalToString

func MustMarshalToString(v interface{}) string

func MustParse

func MustParse(format string, str string) time.Time

func MustParseDate

func MustParseDate(str string) time.Time

func MustParseDateTime

func MustParseDateTime(str string) time.Time

func MustParseTime

func MustParseTime(str string) time.Time

func MustPbTime2Time

func MustPbTime2Time(timestamp *timestamp.Timestamp) time.Time

func MustTime2PbTime

func MustTime2PbTime(time time.Time) *timestamp.Timestamp

func TodayEndTime

func TodayEndTime() time.Time

func TodayStartTime

func TodayStartTime() time.Time

Types

type Color

type Color uint8
const (
	Black Color = iota + 30
	Red
	Green
	Yellow
	Blue
	Magenta
	Cyan
	White
)

func (Color) Add

func (c Color) Add(s string) string

type IdGetter

type IdGetter interface {
	GetId(i int) int
	Len() int
}

Jump to

Keyboard shortcuts

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