utility

package
v0.0.0-...-9e6d8ee Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 5 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteCountIEC

func ByteCountIEC(b int64) string

ByteCountIEC -

func CutShotHash

func CutShotHash(st string, l int) string

CutShotHash -

func TimeStringDateOnly

func TimeStringDateOnly(dur time.Time) (format string)

TimeStringDateOnly -

func TimeStringTimeOnly

func TimeStringTimeOnly(dur time.Time) (format string)

TimeStringTimeOnly -

func TimeStringWitLongDate

func TimeStringWitLongDate(dur time.Time) (format string)

TimeStringWitLongDate -

func TimeStringWithDate

func TimeStringWithDate(dur time.Time) (format string)

TimeStringWithDate -

func TimeToString

func TimeToString(s time.Time) (ts string)

TimeToString -

func TrimSpaceNewlineInString

func TrimSpaceNewlineInString(s string) string

TrimSpaceNewlineInString -

func UniqueInt

func UniqueInt(intSlice []int) []int

UniqueInt -

func UniqueInt64

func UniqueInt64(intSlice []int64) []int64

UniqueInt64 -

func UniqueString

func UniqueString(intSlice []string) []string

UniqueString -

Types

type SubChannel

type SubChannel struct {
	Channel   chan struct{}
	CloseOnce sync.Once
	Ticker    *time.Ticker
	sync.Mutex
}

SubChannel -

func (*SubChannel) Close

func (cc *SubChannel) Close(callback func())

Close -

type TimeString

type TimeString struct {
	Date time.Time
	// contains filtered or unexported fields
}

TimeString -

func NewTimeString

func NewTimeString(tt time.Time) *TimeString

NewTimeString -

func (*TimeString) Output

func (cc *TimeString) Output() (sr string)

Output -

func (*TimeString) WithDate

func (cc *TimeString) WithDate() *TimeString

WithDate -

func (*TimeString) WithLongDate

func (cc *TimeString) WithLongDate() *TimeString

WithLongDate -

func (*TimeString) WithMilliSecond

func (cc *TimeString) WithMilliSecond() *TimeString

WithMilliSecond -

func (*TimeString) WithTime

func (cc *TimeString) WithTime() *TimeString

WithTime -

type UserAgent

type UserAgent struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Version   string `json:"version"`
	OS        string `json:"os"`
	OSVersion string `json:"osVersion"`
	Raw       string `json:"raw"`
}

UserAgent -

Jump to

Keyboard shortcuts

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