utils

package
v0.0.0-...-bf55a12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Copyright 2022 Reto Gantenbein SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](s []T, e T) bool

Check if slice contains element

func FilenameFromUri

func FilenameFromUri(uri string) string

FilenameFromUri returns the last element of an URI If the URI is empty, FilenameFromUri returns "/".

func FilepathFromUri

func FilepathFromUri(uri string) string

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

Return a list of the keys of a map

func ListDifference

func ListDifference[T comparable](a []T, b []T) []T

Return 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

Return the intersection of 2 lists (unique list of all items in both)

func RouteFromUri

func RouteFromUri(uri string) string

RouteFromUri returns the element before the second "/".

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL