utils

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareNullableIntsWithNilAsInfinity added in v0.10.0

func CompareNullableIntsWithNilAsInfinity(a, b *int64) int

CompareNullableIntsWithNilAsInfinity compare two *int64 and handles nil as infinity. It returns 0 if both are equal, a positive value if a is greater than b, a negative value if a is less than b

func CreateMytokenSubject

func CreateMytokenSubject(oidcSub, oidcIss string) string

CreateMytokenSubject creates the subject of a Mytoken from the oidc subject and oidc issuer

func GetBoolFromAnyMap added in v0.10.0

func GetBoolFromAnyMap(m map[string]any, key string) bool

GetBoolFromAnyMap returns a bool value from a map[string]any

func GetStringFromAnyMap added in v0.10.0

func GetStringFromAnyMap(m map[string]any, key string) string

GetStringFromAnyMap returns a string value from a map[string]any

func OR added in v0.10.0

func OR(bools ...bool) bool

OR logically ORs multiple bools

func ORErrors added in v0.10.0

func ORErrors(errs ...error) error

ORErrors returns the first passed error that is not nil

func RSplitN added in v0.10.0

func RSplitN(s, del string, n int) []string

RSplitN splits a string s at the delimiter del into n pieces. Unlike strings.SplitN RSplitN splits the string starting from the right side

func SplitIgnoreEmpty added in v0.10.0

func SplitIgnoreEmpty(s, del string) (ret []string)

SplitIgnoreEmpty splits a string at the specified delimiter without generating empty parts

func StructToStringMap added in v0.10.0

func StructToStringMap(st interface{}, tag string) map[string]string

StructToStringMap creates a string map from an interface{} using the passed tag name

func StructToStringMapUsingJSONTags added in v0.10.0

func StructToStringMapUsingJSONTags(st interface{}) map[string]string

StructToStringMapUsingJSONTags creates a string map from an interface{} using json tags

Types

This section is empty.

Jump to

Keyboard shortcuts

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