common

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyDict = errors.New("the input dict is empty")
View Source
var ErrEmptyList = errors.New("the input list is empty")
View Source
var ErrEmptySet = errors.New("the input set is empty")
View Source
var ErrIllegalParamCount = errors.New("illegal number of input parameters")
View Source
var ErrIllegalReturnCount = errors.New("illegal number of return values")
View Source
var ErrInvalidCapacity = errors.New("the capacity must be an positive integer")
View Source
var ErrInvalidRange = errors.New("the range is invalid with the step: [start < end and step < 0] or [start > end and step > 0]")
View Source
var ErrInvalidType = errors.New("the entry type is not expected")
View Source
var ErrKeyNotFound = errors.New("the key is not found in the dict")
View Source
var ErrListLengthMismatch = errors.New("the length of the input lists are not equal")
View Source
var ErrNoReturn = errors.New("the input function has no return values")
View Source
var ErrNotBool = errors.New("the value is not a boolean value")
View Source
var ErrNotFunc = errors.New("the input parameter is not a function")
View Source
var ErrNotIterable = errors.New("the input parameter is not iterable")
View Source
var ErrNotJudgeFunc = errors.New("the input func is not a function for judge")
View Source
var ErrNotList = errors.New("the input parameter must be a slice or array")
View Source
var ErrNotMap = errors.New("the input parameter is not a map")
View Source
var ErrNotSeq = errors.New("the input parameter is not a sequence (slice/array/string)")
View Source
var ErrOutOfRange = errors.New("the index is out of range")
View Source
var ErrTooManyArguments = errors.New("too many arguments")
View Source
var ErrZeroStep = errors.New("the step cannot be zero")
View Source
var IterableContainers = append(SequenceType, reflect.Map)
View Source
var SequenceType = append(ArrayType, reflect.String)

Functions

func CheckRange

func CheckRange(start, end, step, length int) (err error)

func Contains

func Contains(entry, value any) bool

func ConvertMapToLists

func ConvertMapToLists(entry map[any]any) (keys, values []any, length int)

func ConvertStringToList

func ConvertStringToList(entry string) (output []any)

func CopyList

func CopyList(entry reflect.Value, length int) (output []any)

func CopyMap

func CopyMap(entry reflect.Value, length int) (output map[any]any)

func Count

func Count(entry, value any) (count int)

func Equal

func Equal(a, b any) (equal bool)

func GetMapInitialCapacity

func GetMapInitialCapacity(elementCount int) int

func IsInputFuncValid

func IsInputFuncValid(f any, inputCount, outputCount int) error

func IsIterable

func IsIterable(entry any) error

func IsJudgeFunc

func IsJudgeFunc(f any) (err error)

func IsList

func IsList(entry any) error

func IsSequence

func IsSequence(entry any) error

func Len

func Len(entry any) (length int)

func ParseIndex

func ParseIndex(index, length int) int

func WillReHash

func WillReHash(oldElementCount, newElementCount int) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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