Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstNonZero ¶
func FirstNonZero[T comparable](vars ...T) T
func GetFirstOrDefault ¶
func GetFirstOrDefault[T any](variable []T) T
GetFirstOrDefault gets the first element of a slice, or the default value of the type if the slice is empty
func ResetTimeFields ¶
func ResetTimeFields[T any](input T) T
ResetTimeFields resets all time.Time fields in a struct to the zero value This is done when comparing structs to ignore time.Time fields, since they are not guaranteed to be equal using == (they have their own Equal() method)
func UpdateIfDiff ¶
func UpdateIfDiff[T subsystems.SsResource](dbResource T, fetchFunc func() (T, error), updateFunc func(T) (T, error), recreateFunc func(T) error) error
UpdateIfDiff is a common function that services use to update subsystem resources if there is a diff in the database and live model.
This is the core functionality that enables repairing subsystem resources.
Types ¶
type UpdateDbSubsystem ¶
UpdateDbSubsystem is a common interface that services use to update subsystem resources
Click to show internal directories.
Click to hide internal directories.