Documentation
¶
Index ¶
- Variables
- func CopyMap[K comparable, V any](in map[K]V) map[K]V
- func CopyPtr[T any](p *T) *T
- func Deref[T any](p *T, def T) T
- func DerefMap[S any, D any](p *S, f func(S) D, def D) D
- func DerefSlice[T any](p *[]T) []T
- func DerefSlicePtr[S any, D any](p *[]S, f func(S) D) []D
- func DerefSlicePtrE[S any, D any](p *[]S, f func(S) (D, error)) ([]D, error)
- func DetermineNoOfWorkers(jobsCount, wantedWorkersCount int) int
- func Int64PtrToString(p *int64) string
- func Int64PtrToStringPtr(p *int64) *string
- func Int64ToString(v int64) string
- func JSON(w io.Writer, v any) error
- func MapMap[K comparable, S any, D any](in map[K]S, f func(S) D) map[K]D
- func MapNullable[T, U any](n nullable.Nullable[T], f func(T) U) (*U, error)
- func MapNullableSlice[S, D any](n nullable.Nullable[[]S], f func(S) D) (*[]D, error)
- func MapNullableSliceV[S, D any](n nullable.Nullable[[]S], f func(S) D) ([]D, error)
- func MapNullableV[T, U any](n nullable.Nullable[T], f func(T) U, def U) (U, error)
- func MapPtr[S, D any](p *S, f func(S) D) *D
- func MapSlice[S any, D any](in []S, f func(S) D) []D
- func Ptr[T any](v T) *T
- func PtrCopyMap[K comparable, V any](in map[K]V) *map[K]V
- func PtrIf[T comparable](v, zero T) *T
- func PtrIfNonEmptyMap[K comparable, V any](m map[K]V) *map[K]V
- func PtrIfNonEmptySlice[T any](s []T) *[]T
- func PtrIfNonZero[T ~int | ~int32 | ~int64](v T) *T
- func StringPtrToInt64(p *string) (int64, error)
- func StringPtrToInt64Ptr(p *string) (*int64, error)
- func StringToInt32Ptr(s string) (*int32, error)
- func StringToInt64(s string) (int64, error)
- func StringToInt64Ptr(s string) (*int64, error)
- func SupportedCamundaVersionsString() string
- func ToJSONString(v any) string
- func UniqueSlice[T comparable](in []T) []T
- type CamundaVersion
Constants ¶
This section is empty.
Variables ¶
var ErrUnknownCamundaVersion = errors.New("unknown Camunda version")
Functions ¶
func CopyMap ¶ added in v0.1.64
func CopyMap[K comparable, V any](in map[K]V) map[K]V
CopyMap returns a shallow copy of in (nil-safe).
func CopyPtr ¶
func CopyPtr[T any](p *T) *T
CopyPtr returns a new pointer with the same value, or nil if input is nil.
func Deref ¶
func Deref[T any](p *T, def T) T
Deref returns the value pointed to by p, or def if p is nil.
func DerefSlice ¶
func DerefSlice[T any](p *[]T) []T
DerefSlice returns a copy of the slice pointed to by p, or nil if p is nil.
func DerefSlicePtr ¶
DerefSlicePtr maps *[]S -> []D
func DerefSlicePtrE ¶
DerefSlicePtrE maps *[]S -> []D using f(S) (D, error). Returns nil, nil if p is nil.
func DetermineNoOfWorkers ¶ added in v0.1.71
func Int64PtrToString ¶
Int64PtrToString converts *int64 → string, returns "" if nil.
func Int64PtrToStringPtr ¶
Int64PtrToStringPtr maps *int64 -> *string using strconv.FormatInt. Returns nil if input is nil.
func MapMap ¶
func MapMap[K comparable, S any, D any](in map[K]S, f func(S) D) map[K]D
MapMap maps a map’s values to a new map with the same keys.
func MapNullable ¶
MapNullable maps a nullable.Nullable[T] to *U using f. Returns nil when the field is unspecified OR explicitly null. Propagates Get() errors from the nullable package.
func MapNullableSlice ¶
MapNullableSlice maps a nullable.Nullable[[]S] to *[]D using f for elements. Returns nil when the field is unspecified OR explicitly null.
func MapNullableSliceV ¶
MapNullableSliceV maps a nullable slice to a []D; returns nil (or empty) for unspecified/null.
func MapNullableV ¶
MapNullableV maps a nullable field to a value using f; returns def for unspecified or null.
func MapPtr ¶
func MapPtr[S, D any](p *S, f func(S) D) *D
MapPtr applies f to *S and returns *D (nil-safe).
func PtrCopyMap ¶ added in v0.1.64
func PtrCopyMap[K comparable, V any](in map[K]V) *map[K]V
PtrCopyMap returns a pointer to a new shallow copy of in. Nil-safe. Uses CopyMap.
func PtrIf ¶
func PtrIf[T comparable](v, zero T) *T
PtrIf returns a pointer to v if v != zero, otherwise nil. T must be comparable (e.g. not slices, maps, funcs). Examples: PtrIf("", "") -> nil PtrIf("x", "") -> *"x" PtrIf(int64(0), int64(0)) -> nil
func PtrIfNonEmptyMap ¶ added in v0.1.64
func PtrIfNonEmptyMap[K comparable, V any](m map[K]V) *map[K]V
PtrIfNonEmptyMap returns *map when m has at least one entry, otherwise nil. The pointer is to a copy of the map header, not a deep copy.
func PtrIfNonEmptySlice ¶ added in v0.1.64
func PtrIfNonEmptySlice[T any](s []T) *[]T
PtrIfNonEmptySlice returns *[]T when s has at least one element, otherwise nil.
func PtrIfNonZero ¶
PtrIfNonZero returns a pointer to v if v != 0, otherwise nil.
func StringPtrToInt64 ¶
StringPtrToInt64 converts *string → int64 (0 if nil), error if parsing fails.
func StringPtrToInt64Ptr ¶
StringPtrToInt64Ptr converts *string → *int64. Returns nil if input is nil, error if parsing fails.
func StringToInt32Ptr ¶ added in v0.1.71
func StringToInt64 ¶
StringToInt64 converts string → int64, returns error if not parsable.
func StringToInt64Ptr ¶
StringToInt64Ptr converts string → *int64, returns nil if empty, error if invalid.
func SupportedCamundaVersionsString ¶
func SupportedCamundaVersionsString() string
func ToJSONString ¶
ToJSONString returns v as a pretty-printed JSON string.
func UniqueSlice ¶ added in v0.1.71
func UniqueSlice[T comparable](in []T) []T
UniqueSlice returns a new slice with duplicates removed, order preserved.
Types ¶
type CamundaVersion ¶
type CamundaVersion string
const ( V87 CamundaVersion = "8.7" V88 CamundaVersion = "8.8" V89 CamundaVersion = "8.9" CurrentCamundaVersion = V88 )
func NormalizeCamundaVersion ¶
func NormalizeCamundaVersion(s string) (CamundaVersion, error)
func SupportedCamundaVersions ¶
func SupportedCamundaVersions() []CamundaVersion
func (CamundaVersion) FilePrefix ¶ added in v0.1.67
func (v CamundaVersion) FilePrefix() string
func (CamundaVersion) String ¶
func (v CamundaVersion) String() string