utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyMatch

func AnyMatch(regexes []*regexp.Regexp, s *string) bool

func CompareFileReferences

func CompareFileReferences(a, b *models.FileReference) bool

func Filter

func Filter[T any](s []T, cb func(v T) bool) []T

func GetHttpClient

func GetHttpClient(credentials *models.Credentials) *req.Client

ToDo: change to SetCommonBearerAuthToken and test

func GetHttpClientWithBasicAuth

func GetHttpClientWithBasicAuth(credentials *models.Credentials) *req.Client

func GetMapKeys

func GetMapKeys[T comparable, U any](m map[T]U) []T

func GetPtr

func GetPtr[T any](v T) *T

func GetPtrOrNil

func GetPtrOrNil[T comparable](v T) *T

func IsArray

func IsArray(input any) bool

func Map

func Map[T any, U any](s []T, cb func(v T) U) []U

func MapToSlice

func MapToSlice[T any, U any, K comparable](m map[K]T, cb func(k K, v T) U) []U

func MapToSliceErr

func MapToSliceErr[T any, U any, K comparable](m map[K]T, cb func(k K, v T) (U, error)) ([]U, error)

func MapWithIndex

func MapWithIndex[T any, U any](s []T, cb func(v T, i int) U) []U

func SliceContains

func SliceContains[T comparable](s []T, v T) bool

func SliceContainsBy

func SliceContainsBy[T comparable](s []T, v T, cb func(y, u T) bool) bool

func SliceToMap

func SliceToMap[T comparable, U any](s []T, cb func(v T) U) map[T]U

func ToSlice

func ToSlice[T any](v any) ([]T, bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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