Documentation ¶
Index ¶
- func JoinBools[Bool ~bool](slice []Bool) string
- func JoinDurations(slice []time.Duration) string
- func JoinFloats[Float constraints.Float](slice []Float) string
- func JoinFunc[T any](slice []T, each func(buf []byte, idx int) []byte, size int) string
- func JoinInts[Int constraints.Signed](slice []Int) string
- func JoinSizes(slice []bytesize.Size) string
- func JoinStrings[String ~string](slice []String) string
- func JoinTimes(slice []time.Time, format string) string
- func JoinUints[Uint constraints.Unsigned](slice []Uint) string
- func SplitBools[Bool ~bool](str string) ([]Bool, error)
- func SplitDurations(str string) ([]time.Duration, error)
- func SplitFloats[Float constraints.Float](str string) ([]Float, error)
- func SplitFunc(str string, fn func(string) error) error
- func SplitInts[Int constraints.Signed](str string) ([]Int, error)
- func SplitSizes(str string) ([]bytesize.Size, error)
- func SplitStrings[String ~string](str string) ([]String, error)
- func SplitTimes(str string, format string) ([]time.Time, error)
- func SplitUints[Uint constraints.Unsigned](str string) ([]Uint, error)
- type Splitter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JoinBools ¶ added in v1.1.0
JoinBools will pass bool slice to JoinFunc(), formatting and combining into a single comma-space separated string.
func JoinDurations ¶ added in v1.1.0
JoinDurations will pass duration slice to JoinFunc(), formatting and combining into a single comma-space separated string.
func JoinFloats ¶ added in v1.1.0
func JoinFloats[Float constraints.Float](slice []Float) string
JoinFloats will pass float slice to JoinFunc(), formatting and combining into a single comma-space separated string.
func JoinFunc ¶ added in v1.1.0
JoinFunc will join given slice of elements, using the passed function to append each element at index from the slice, forming a combined comma-space separated string. Passed size is for buffer preallocation.
func JoinInts ¶ added in v1.1.0
func JoinInts[Int constraints.Signed](slice []Int) string
JoinInts will pass signed integer slice to JoinFunc(), formatting and combining into a single comma-space separated string.
func JoinSizes ¶ added in v1.1.0
func JoinSizes(slice []bytesize.Size) string
JoinSizes will pass byte size slice to JoinFunc(), formatting and combining into a single comma-space separated string.
func JoinStrings ¶ added in v1.1.0
JoinStrings will pass string slice to JoinFunc(), quoting where necessary and combining into a single comma-space separated string.
func JoinTimes ¶ added in v1.1.0
JoinTimes will pass time slice to JoinFunc(), formatting and combining into a single comma-space separated string.
func JoinUints ¶ added in v1.1.0
func JoinUints[Uint constraints.Unsigned](slice []Uint) string
JoinUints will pass unsigned integer slice to JoinFunc(), formatting and combining into a single comma-space separated string.
func SplitBools ¶ added in v1.1.0
SplitBools will pass string input to SplitFunc(), parsing and compiling a slice of bools.
func SplitDurations ¶ added in v1.1.0
SplitDurations will pass string input to SplitFunc(), parsing and compiling a slice of durations.
func SplitFloats ¶ added in v1.1.0
func SplitFloats[Float constraints.Float](str string) ([]Float, error)
SplitFloats will pass string input to SplitFunc(), parsing and compiling a slice of floats.
func SplitFunc ¶ added in v1.1.0
SplitFunc will split input string on commas, taking into account string quoting and stripping extra whitespace, passing each split to the given function hook.
func SplitInts ¶ added in v1.1.0
func SplitInts[Int constraints.Signed](str string) ([]Int, error)
SplitInts will pass string input to SplitFunc(), parsing and compiling a slice of signed integers.
func SplitSizes ¶ added in v1.1.0
SplitSizes will pass string input to SplitFunc(), parsing and compiling a slice of byte sizes.
func SplitStrings ¶ added in v1.1.0
SplitStrings will pass string input to SplitFunc(), compiling a slice of strings.
func SplitTimes ¶ added in v1.1.0
SplitTimes will pass string input to SplitFunc(), parsing and compiling a slice of times.
func SplitUints ¶ added in v1.1.0
func SplitUints[Uint constraints.Unsigned](str string) ([]Uint, error)
SplitUints will pass string input to SplitFunc(), parsing and compiling a slice of unsigned integers.