Documentation
¶
Index ¶
- Variables
- func ContextWithStopCh(ctx context.Context, stopCh <-chan struct{}) context.Context
- func EqualUnsorted(s1 []string, s2 []string) bool
- func OnlyOneNotNil(items ...interface{}) (any bool, one bool)
- func RandStringRunes(n int) string
- func RemoveDuplicates(in []string) []string
- type FilterFn
- type StringFilterT
- type StringFilterWrapper
Constants ¶
This section is empty.
Variables ¶
View Source
var (
AppGitState = ""
AppGitCommit = ""
AppVersion = "canary"
)
Functions ¶
func ContextWithStopCh ¶
func ContextWithStopCh(ctx context.Context, stopCh <-chan struct{}) context.Context
func EqualUnsorted ¶
func EqualUnsorted(s1 []string, s2 []string) bool
func OnlyOneNotNil ¶
func OnlyOneNotNil(items ...interface{}) (any bool, one bool)
func RandStringRunes ¶
func RandStringRunes(n int) string
func RemoveDuplicates ¶ added in v0.2.1
func RemoveDuplicates(in []string) []string
Types ¶
type FilterFn ¶
type FilterFn func(string) (filter bool, err error)
FilterFn is a function used to filter a list of string. If the function returns false or a non-nil error, it will not be filtered.
type StringFilterT ¶
type StringFilterT struct {
String string
Err error
}
StringFilterT is a tuple for a value that has not been filtered out
type StringFilterWrapper ¶
type StringFilterWrapper []StringFilterT
func StringFilter ¶
func StringFilter(fn FilterFn, in ...string) StringFilterWrapper
StringFilter will run fn with each element of in, filtering out elements. it will return a slice of results where fn returned ok, or a non-nil error. it will also call each instance of fn in it's own goroutine.
Click to show internal directories.
Click to hide internal directories.