structutil

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountID added in v1.0.16

func AccountID[I any, T got.AccountIDProvider[I]](s T) I

func Amount added in v1.0.16

func Amount[I any, T got.AmountProvider[I]](s T) I

func Choose

func Choose[T got.ZeroCheckable](values ...T) T

Choose returns the first non-zero value from the list of values.

func Compare

func Compare[T any, V got.Comparable[T]](a V, b T) int

Compare returns the result of comparing two values.

func CompareBy

func CompareBy[T any, V got.Comparable[V]](f func(T) V) func(T, T) int

CompareBy returns a function that compares two values by a given function. The function must return a value that implements the CompareProvider interface.

func CompareTo

func CompareTo[T any, V got.Comparable[T]](b T) func(V) int

CompareTo returns a function that compares a value to another value.

func CreatedAt added in v1.0.16

func CreatedAt[I any, T got.CreatedAtProvider[I]](s T) I

func CustomerID added in v1.0.16

func CustomerID[I any, T got.CustomerIDProvider[I]](s T) I

func Equal

func Equal[T any, V got.Comparable[T]](a V, b T) bool

Equal checks if two values are equal.

func EqualTo

func EqualTo[T any, V got.Comparable[T]](v T) func(V) bool

EqualTo returns a predicate that checks if a value is equal to a given value.

func EventID added in v1.0.16

func EventID[I any, T got.EventIDProvider[I]](s T) I

func EventName added in v1.0.16

func EventName[I any, T got.EventNameProvider[I]](s T) I

func GreaterOrEqualTo

func GreaterOrEqualTo[T any, V got.Comparable[T]](v T) func(V) bool

GreaterOrEqualTo returns a predicate that checks if a value is greater than or equal to a given value.

func GreaterThan

func GreaterThan[T any, V got.Comparable[T]](v T) func(V) bool

GreaterThan returns a predicate that checks if a value is greater than a given value.

func ID added in v1.0.16

func ID[I any, T got.Identifiable[I]](s T) I

func InRange

func InRange[T any, V got.Comparable[T]](min, max T) func(V) bool

InRange returns a predicate that checks if a value is in a range (inclusive).

func IsZero

func IsZero[T got.ZeroCheckable](v T) bool

IsZero returns result of zero testing.

func LessOrEqualTo

func LessOrEqualTo[T any, V got.Comparable[T]](v T) func(V) bool

LessOrEqualTo returns a predicate that checks if a value is less than or equal to a given value.

func LessThan

func LessThan[T any, V got.Comparable[T]](v T) func(V) bool

LessThan returns a predicate that checks if a value is less than a given value.

func Name added in v1.0.16

func Name[I any, T got.Named[I]](s T) I

func Priority added in v1.0.16

func Priority[I any, T got.PriorityProvider[I]](s T) I

func ProductID added in v1.0.16

func ProductID[I any, T got.ProductIDProvider[I]](s T) I

func TransactionID added in v1.0.16

func TransactionID[I any, T got.TransactionIDProvider[I]](s T) I

func UpdatedAt added in v1.0.16

func UpdatedAt[I any, T got.UpdatedAtProvider[I]](s T) I

func ValueTime added in v1.0.16

func ValueTime[I any, T got.ValueTimeProvider[I]](s T) I

Types

This section is empty.

Jump to

Keyboard shortcuts

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