Documentation
¶
Overview ¶
Copyright 2022 Reto Gantenbein SPDX-License-Identifier: Apache-2.0
Index ¶
- func Contains[T comparable](s []T, e T) bool
- func FilenameFromURI(uri string) string
- func FilepathFromURI(uri string) string
- func KeysFromMap[T constraints.Ordered, S any](a map[T]S) []T
- func ListDifference[T comparable](a []T, b []T) []T
- func ListIntersection[T comparable](a []T, b []T) []T
- func RouteFromURI(uri string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](s []T, e T) bool
Contains checks if slice contains element
func FilenameFromURI ¶
FilenameFromURI returns the last element of an URI If the URI is empty, FilenameFromUri returns "/".
func FilepathFromURI ¶
FilepathFromURI returns all but the last element of an URI If the URI is empty, FilepathFromURI returns "/".
func KeysFromMap ¶
func KeysFromMap[T constraints.Ordered, S any](a map[T]S) []T
KeysFromMap returns a list of the keys of a map
func ListDifference ¶
func ListDifference[T comparable](a []T, b []T) []T
ListDifference returns the difference of 2 lists (items in `a` that don’t exist in `b`)
func ListIntersection ¶
func ListIntersection[T comparable](a []T, b []T) []T
ListIntersection returns the intersection of 2 lists (unique list of all items in both)
func RouteFromURI ¶
RouteFromURI returns the element before the second "/".
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.