Documentation
¶
Index ¶
- func Abs[N Number](n N) N
- func BoolToStr(b bool, ifTrue string, ifFalse string) string
- func Clone[T any](t *T) *T
- func DeepEqualWithUnionHandling(v1, v2 reflect.Value) bool
- func DefaultBoolIfNil(b *bool, defaultB bool) bool
- func DefaultIfError(fn StringerWithError, defaultS string) string
- func DefaultIfNil(s *string, defaultS string) string
- func DefaultIfNotInMap(m map[string]string, key string, def string) string
- func DefaultString(s string, defaultS string) string
- func EnsureMap[T comparable, U any](m map[T]U) map[T]U
- func GetFromMap[K comparable, V any](in map[K]V, key K) (V, bool)
- func GetOrgIdFromContext(ctx context.Context) (uuid.UUID, bool)
- func GetResourceOwner(owner *string) (string, string, error)
- func IsEmptyString(s *string) bool
- func LabelArrayToMap(labels []string) map[string]string
- func LabelMapToArray(labels *map[string]string) []string
- func LabelsMatchLabelSelector(labels map[string]string, labelSelector map[string]string) bool
- func Max[N Number](n1, n2 N) N
- func MergeLabels(labels ...map[string]string) map[string]string
- func Min[N Number](n1, n2 N) N
- func Must(err error)
- func MustString(fn StringerWithError) string
- func OwnerQueryParamsToArray(ownerQueryParam *string) []string
- func ResourceOwner(kind string, name string) string
- func SetResourceOwner(kind string, name string) *string
- func SingleQuote(input []string) []string
- func SliceToPtrWithNilDefault(s []string) *[]string
- func StringsAreEqual(a, b *string) bool
- func StructToMap(obj interface{}) (map[string]interface{}, error)
- func TimeStampString() string
- func TimeStampStringPtr() *string
- func ToPtrWithNilDefault[T comparable](i T) *T
- func WithOrganizationID(ctx context.Context, orgID uuid.UUID) context.Context
- type Duration
- type Number
- type Singleton
- type StringerWithError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeepEqualWithUnionHandling ¶ added in v0.9.0
func DefaultBoolIfNil ¶
func DefaultIfError ¶
func DefaultIfError(fn StringerWithError, defaultS string) string
func DefaultIfNil ¶
func DefaultIfNotInMap ¶ added in v0.2.0
func DefaultString ¶
func EnsureMap ¶ added in v0.4.0
func EnsureMap[T comparable, U any](m map[T]U) map[T]U
EnsureMap takes a map as input and guarantees that it is not nil. If the input map is nil, it initializes and returns a new empty map of the same type. If the input map is already initialized, it simply returns the map unchanged.
func GetFromMap ¶ added in v0.4.0
func GetFromMap[K comparable, V any](in map[K]V, key K) (V, bool)
func GetOrgIdFromContext ¶ added in v0.9.0
func IsEmptyString ¶
func LabelArrayToMap ¶
func LabelMapToArray ¶
func MustString ¶
func MustString(fn StringerWithError) string
func OwnerQueryParamsToArray ¶
func ResourceOwner ¶ added in v0.4.0
func SetResourceOwner ¶
func SingleQuote ¶
func StringsAreEqual ¶ added in v0.7.0
func StructToMap ¶ added in v0.6.0
func TimeStampString ¶ added in v0.4.0
func TimeStampString() string
func TimeStampStringPtr ¶
func TimeStampStringPtr() *string
func ToPtrWithNilDefault ¶ added in v0.4.0
func ToPtrWithNilDefault[T comparable](i T) *T
Types ¶
type Number ¶ added in v0.4.0
type Number interface { constraints.Integer | constraints.Float }
type Singleton ¶ added in v0.6.0
type Singleton[T any] struct { // contains filtered or unexported fields }
type StringerWithError ¶
Click to show internal directories.
Click to hide internal directories.