utils

package
v3.8.1-rc.9 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildGroupName

func BuildGroupName(ownerID, type_ string) string

func CancelAndReBuildCtx added in v3.8.1

func CancelAndReBuildCtx(
	buildFunc func(ctx context.Context) context.Context,
	cancel ...context.CancelFunc,
) context.Context

func FormatErrorStack added in v3.8.1

func FormatErrorStack(err error) string

func FuncProgressBarPrint

func FuncProgressBarPrint(ctx context.Context, gr *reerrgroup.Group, progress, total *atomic.Int64)

func GetUserID

func GetUserID(num int) string

func GetUserNum

func GetUserNum(id string) (int, error)

func IsSuperUser

func IsSuperUser(id string) bool

IsSuperUser check if the user has all friends

func MustGetUserNum

func MustGetUserNum(id string) int

func NextNum

func NextNum(num int) int

NextNum get next num.

func NextOffsetNum

func NextOffsetNum(num, offset int) int

NextOffsetNum get num with an offset behind.

func NextOffsetNums

func NextOffsetNums(userNum, offset int) []int

NextOffsetNums get num with an offset behind.

func NextOffsetUserIDs

func NextOffsetUserIDs(userNum, offset int) []string

NextOffsetUserIDs get userIDs with an offset behind.

func PreOffsetNum

func PreOffsetNum(num, offset int) int

PreOffsetNum get num with an offset forward.

func ProgressBarPrint

func ProgressBarPrint(ctx context.Context, title string, gr *reerrgroup.Group, progress, total *atomic.Int64)

Types

This section is empty.

Jump to

Keyboard shortcuts

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