util

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRunningOrderedFiles

func GetRunningOrderedFiles(pathes []string, orders []config.Order) (files []string, err error)

func ItemInIntArray

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

func OmitMiddle

func OmitMiddle(s string, head int, tail int) string

func PrettyStringSlice

func PrettyStringSlice(s []string) string

func StringArrayMapFunc added in v1.0.9

func StringArrayMapFunc(elements []string, f func(string) string) (result []string)

func ToLower

func ToLower(ss []string) []string

func TruncateBytes

func TruncateBytes(content []byte, length int) []byte

TruncateBytes truncate []byte to specific length

func TruncateBytesToString

func TruncateBytesToString(content []byte, length int) string

TruncateBytesToString ...

func TruncateString

func TruncateString(s string, n int) string

TruncateString truncate string to specific length

Types

type Int64Set

type Int64Set struct {
	Data map[int64]struct{}
}

Int64Set ...

func NewFixedLengthInt64Set

func NewFixedLengthInt64Set(length int) *Int64Set

NewFixedLengthInt64Set ...

func NewInt64Set

func NewInt64Set() *Int64Set

NewInt64Set ...

func NewInt64SetWithValues

func NewInt64SetWithValues(keys []int64) *Int64Set

NewInt64SetWithValues ...

func (*Int64Set) Add

func (s *Int64Set) Add(key int64)

Add ...

func (*Int64Set) Append

func (s *Int64Set) Append(keys ...int64)

Append ...

func (*Int64Set) Has

func (s *Int64Set) Has(key int64) bool

Has ...

func (*Int64Set) Size

func (s *Int64Set) Size() int

Size ...

func (*Int64Set) ToSlice

func (s *Int64Set) ToSlice() []int64

ToSlice ...

type Message

type Message struct {
	Type string
	Text string
}

type Stats

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

func (*Stats) AddErrorMessage

func (s *Stats) AddErrorMessage(format string, args ...interface{})

func (*Stats) AddFailMessage

func (s *Stats) AddFailMessage(format string, args ...interface{})

func (*Stats) AddInfoMessage

func (s *Stats) AddInfoMessage(format string, args ...interface{})

func (*Stats) AddInfofMessage

func (s *Stats) AddInfofMessage(format string, args ...interface{})

func (*Stats) AddMessage

func (s *Stats) AddMessage(msg Message)

func (*Stats) AddPassMessage

func (s *Stats) AddPassMessage()

func (*Stats) AddTipMessage

func (s *Stats) AddTipMessage(format string, args ...interface{})

func (*Stats) AllPassed

func (s *Stats) AllPassed() bool

func (*Stats) GetFailAssertCount

func (s *Stats) GetFailAssertCount() int64

func (*Stats) GetFailCaseCount

func (s *Stats) GetFailCaseCount() int64

func (*Stats) GetMessages

func (s *Stats) GetMessages() []Message

func (*Stats) GetOkAssertCount

func (s *Stats) GetOkAssertCount() int64

func (*Stats) GetOkCaseCount

func (s *Stats) GetOkCaseCount() int64

func (*Stats) IncrFailAssertCount

func (s *Stats) IncrFailAssertCount()

func (*Stats) IncrFailAssertCountByN

func (s *Stats) IncrFailAssertCountByN(n int64)

func (*Stats) IncrFailCaseCount

func (s *Stats) IncrFailCaseCount()

func (*Stats) IncrFailFileCount

func (s *Stats) IncrFailFileCount()

func (*Stats) IncrOkAssertCount

func (s *Stats) IncrOkAssertCount()

func (*Stats) IncrOkCaseCount

func (s *Stats) IncrOkCaseCount()

func (*Stats) IncrOkFileCount

func (s *Stats) IncrOkFileCount()

func (*Stats) MergeAssertAndCaseCount

func (s *Stats) MergeAssertAndCaseCount(s1 Stats)

func (*Stats) MergeAssertCount

func (s *Stats) MergeAssertCount(s1 Stats)

func (*Stats) PrintMessages

func (s *Stats) PrintMessages()

func (*Stats) Report

func (s *Stats) Report(latency int64)

type StatsCollection

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

func (*StatsCollection) Add

func (sc *StatsCollection) Add(s Stats)

func (*StatsCollection) GetStats

func (sc *StatsCollection) GetStats() Stats

type StringSet

type StringSet struct {
	Data map[string]struct{}
}

StringSet ...

func NewFixedLengthStringSet

func NewFixedLengthStringSet(length int) *StringSet

NewFixedLengthStringSet ...

func NewStringSet

func NewStringSet() *StringSet

NewStringSet ...

func NewStringSetWithValues

func NewStringSetWithValues(keys []string) *StringSet

NewStringSetWithValues ...

func SplitStringToSet

func SplitStringToSet(s string, sep string) *StringSet

SplitStringToSet ...

func (*StringSet) Add

func (s *StringSet) Add(key string)

Add ...

func (*StringSet) Append

func (s *StringSet) Append(keys ...string)

Append ...

func (*StringSet) Diff

func (s *StringSet) Diff(b *StringSet) *StringSet

Diff 求差集

func (*StringSet) Has

func (s *StringSet) Has(key string) bool

Has ...

func (*StringSet) Size

func (s *StringSet) Size() int

Size ...

func (*StringSet) ToSlice

func (s *StringSet) ToSlice() []string

ToSlice ...

func (*StringSet) ToString

func (s *StringSet) ToString(sep string) string

ToString ...

Jump to

Keyboard shortcuts

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