Documentation
¶
Index ¶
- func All(a []bool) bool
- func Any(a []bool) bool
- func DNSSafeName(name string) string
- func Filter[V any](f func(V) bool, source []V) []V
- func FilterErr[V any](f func(V) (bool, error), source []V) ([]V, error)
- func Map[A any, B any](f func(A) B, source []A) []B
- func MapErr[A any, B any](f func(A) (B, error), source []A) ([]B, error)
- func NewSprout(opts ...sprout.HandlerOption[*sprout.DefaultHandler]) *sprout.DefaultHandler
- func Reversed[V any](source []V) []V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶ added in v0.4.1
All takes a []bool and returns true if all of the values are true, else false.
func Any ¶ added in v0.4.1
Any takes a []bool and returns true if any of the values are true. If none are true, returns false.
func DNSSafeName ¶
DNSSafeName converts an externally-supplied hostname into one that is safe to be used in a DNS record.
func Filter ¶
Filter returns a new slice with f() applied to each element to determine whether that element should be included in the new slice. Unlike FilterErr, the function should only return a bool depending on whether it should be filtered through or not.
func FilterErr ¶ added in v0.4.1
FilterErr returns a new slice with f() applied to each element to determine whether that element should be included in the new slice. Unlike Filter, the function should return (bool, error) and if an error is returned, FilterErr immediately bubbles the error up instead of continuing with the loop.
func Map ¶ added in v0.4.0
Map calls function f for each item in source slice. Unlike MapErr, the function should only return the B type.
func MapErr ¶ added in v0.4.1
MapErr calls function f for each item in source slice. Unlike Map, the function should return (B, error) and if an error is returned, MapErr immatately bubbles the error up instead of continuing the loop.
func NewSprout ¶ added in v0.8.0
func NewSprout(opts ...sprout.HandlerOption[*sprout.DefaultHandler]) *sprout.DefaultHandler
Types ¶
This section is empty.