checker

package
v3.8.2-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAllLoginNum

func CheckAllLoginNum(ctx context.Context) error

CheckAllLoginNum check if all user is login

func CheckConvNumAfterImpFriAndCrGro

func CheckConvNumAfterImpFriAndCrGro(ctx context.Context) error

CheckConvNumAfterImpFriAndCrGro check conversation num after import friends and create groups.

func CheckGroupNum

func CheckGroupNum(ctx context.Context) error

func CheckLoginByRateNum

func CheckLoginByRateNum(ctx context.Context) error

func CheckLoginUsersFriends

func CheckLoginUsersFriends(ctx context.Context) error

CheckLoginUsersFriends check login users friends

func CheckMessageNum

func CheckMessageNum(ctx context.Context) error

CheckMessageNum check message num.

func CloseAndGetCheckErrChan

func CloseAndGetCheckErrChan() <-chan error

func InsertToErrChan

func InsertToErrChan(ctx context.Context, err error)

Types

type Counter

type Counter struct {
	TotalCount   int
	CorrectCount int
	IsEqual      bool
}

func NewCounter

func NewCounter(total, correct int, isEqual bool) *Counter

type CounterChecker

type CounterChecker[T any, K comparable] struct {
	// CheckName must start with 'check' and be named with a small camel hump,
	// followed by the name of the indicator that needs to be checked,
	// and it will be assigned to checkNumName.
	// e.g. checkGroupNum: checkNumName=GroupNum
	CheckName string

	CheckerKeyName  string // used for printing logs
	GoroutineLimit  int
	GetTotalCount   func(ctx context.Context, t T) (int, error) // get now total count
	CalCorrectCount func(key K) int                             // return correct num
	LoopSlice       []T                                         // circular slicing
	GetKey          func(t T) K                                 // get checkers key from a type
	// contains filtered or unexported fields
}

func (*CounterChecker[T, K]) Check

func (c *CounterChecker[T, K]) Check(ctx context.Context) error

func (*CounterChecker[T, K]) Init

func (c *CounterChecker[T, K]) Init()

func (*CounterChecker[T, K]) LoopCheck

func (c *CounterChecker[T, K]) LoopCheck(ctx context.Context) error

Jump to

Keyboard shortcuts

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