Documentation ¶
Index ¶
- Variables
- func Intersection(s1, s2 []string) []string
- func Split(s []string, f SplitFilter) ([]string, []string)
- func ToSlice(v interface{}) ([]string, error)
- func ToString(v interface{}) (string, bool)
- func ToStringArray(v interface{}) ([]string, bool)
- func Unescape(s string, mode UnescapingMode, multisegment bool) (string, error)
- func Unique(s []string) []string
- type MalformedSequenceError
- type SortedSlice
- func (slice SortedSlice) Contains(s string) bool
- func (slice SortedSlice) Difference(second SortedSlice) SortedSlice
- func (slice SortedSlice) Equal(second SortedSlice) bool
- func (slice SortedSlice) Insert(elems ...string) SortedSlice
- func (slice SortedSlice) Intersection(second SortedSlice) SortedSlice
- func (slice SortedSlice) IsSubslice(s SortedSlice) bool
- func (slice SortedSlice) IsSuperslice(s SortedSlice) bool
- func (slice SortedSlice) Remove(elems ...string) SortedSlice
- type SplitFilter
- type UnescapingMode
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidType = errors.New("invalid type")
Functions ¶
func Intersection ¶
Return slice of unique elements contained by both input slices
func Split ¶
func Split(s []string, f SplitFilter) ([]string, []string)
Split one slice into to based on some filter.
Function returns two slices, first slice contains all elements of the input slice that satisfy the filter, the second slice contains the rest.
func ToStringArray ¶ added in v2.6.1
Types ¶
type MalformedSequenceError ¶ added in v2.17.1
type MalformedSequenceError string
func (MalformedSequenceError) Error ¶ added in v2.17.1
func (e MalformedSequenceError) Error() string
type SortedSlice ¶
type SortedSlice []string
SortedSlice is a sorted slice of strings without duplicates
func MakeSortedSlice ¶
func MakeSortedSlice(slice []string) SortedSlice
func (SortedSlice) Contains ¶
func (slice SortedSlice) Contains(s string) bool
Contains checks whether sorted slice contains the string.
func (SortedSlice) Difference ¶
func (slice SortedSlice) Difference(second SortedSlice) SortedSlice
Difference gets elements of the first slice not contained in the second.
func (SortedSlice) Equal ¶
func (slice SortedSlice) Equal(second SortedSlice) bool
Equal checks if two sorted string slices are equal.
func (SortedSlice) Insert ¶
func (slice SortedSlice) Insert(elems ...string) SortedSlice
Insert inserts string(s) into the sorted slice (preserving valid ordering).
func (SortedSlice) Intersection ¶
func (slice SortedSlice) Intersection(second SortedSlice) SortedSlice
Intersection returns a sorted slice of elements contained by two sorted slices.
func (SortedSlice) IsSubslice ¶
func (slice SortedSlice) IsSubslice(s SortedSlice) bool
IsSubslice checks if slice is a subslice of s (ie. all elements in slice are contained by s)
func (SortedSlice) IsSuperslice ¶
func (slice SortedSlice) IsSuperslice(s SortedSlice) bool
IsSuperslice checks if slice is a superslice of s
func (SortedSlice) Remove ¶
func (slice SortedSlice) Remove(elems ...string) SortedSlice
Remove removes elements from the sorted slice and returns a new slice.
type SplitFilter ¶
type UnescapingMode ¶ added in v2.17.1
type UnescapingMode int
UnescapingMode defines the behavior of ServeMux when unescaping path parameters.
const ( // UnescapingModeAllExceptReserved unescapes all path parameters except RFC 6570 // reserved characters. UnescapingModeAllExceptReserved UnescapingMode = 1 // UnescapingModeAllExceptSlash unescapes URL path parameters except path // separators, which will be left as "%2F". UnescapingModeAllExceptSlash UnescapingMode = 2 // UnescapingModeAllCharacters unescapes all URL path parameters. UnescapingModeAllCharacters UnescapingMode = 3 )