utils

package
v0.0.0-...-4b0ee74 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const DefaultBatchSize = 100

Variables

This section is empty.

Functions

func ExcludeSlice

func ExcludeSlice(all, exclude []string) []string

func FilterParser

func FilterParser(ctx context.Context, f string, filterPointer interface{}) error

func GenerateToken

func GenerateToken(uid int64, expireDuration time.Duration, secretKey string) (string, error)

func IsInArray

func IsInArray(item int, array []int) bool

func IsInStrArray

func IsInStrArray(item string, array []string) bool

func NowUTC

func NowUTC() time.Time

func ParseDay

func ParseDay(tStr string) (time.Time, error)

func RandShuffle

func RandShuffle(slice []interface{})

func RangeParser

func RangeParser(ctx context.Context, r string) (int, int, error)

func SortParser

func SortParser(ctx context.Context, sort string) (string, error)

func Time2TimeStamp

func Time2TimeStamp(t time.Time) int64

func TimeStamp2Time

func TimeStamp2Time(tStamp int64) time.Time

func TimeStamp2UTCTimeString

func TimeStamp2UTCTimeString(tStamp int64) string

func TodayStartUTC

func TodayStartUTC() time.Time

func UniqueArray

func UniqueArray(iArray []int64) []int64

func UniqueStr

func UniqueStr(slice []string) []string

Types

type Batcher

type Batcher struct {
	// contains filtered or unexported fields
}

func NewBatcher

func NewBatcher(count, batchSize int) (*Batcher, error)

func (*Batcher) Iter

func (i *Batcher) Iter(start, length *int) bool

type JwtClaims

type JwtClaims struct {
	Uid            int64
	StandardClaims jwt.StandardClaims
}

func (JwtClaims) Valid

func (j JwtClaims) Valid() error

Jump to

Keyboard shortcuts

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