Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyStruct struct{}
Functions ¶
func DatesEqual ¶
DatesEqual compares 2 *time.Time. If either is nil, returns false. Otherwise, returns true if the years, months, and days are the same.
func OneToMany ¶
func OneToMany[valT Mapper[keyT, retT], keyT comparable, retT any](keys []keyT, vals []valT) [][]retT
OneToMany takes a list of keys and a list of values which map one-to-many (key-to-value) ex: vals could be a list of contract numbers where more than one value has the same mapped ID
func OneToOne ¶
func OneToOne[valT Mapper[keyT, retT], keyT comparable, retT any](keys []keyT, vals []valT) []retT
OneToOne takes a list of keys and a list of values which map one-to-one (key-to-value)
Types ¶
type Mapper ¶
type Mapper[keyT comparable, valT any] interface { GetMappingKey() keyT GetMappingVal() valT // in cases where the return value is not embedded, this should simply be a pointer to the original struct }
Mapper can be implemented so that it can use OneToMany below to map a flat list of values to a flat list of their relative keys
Click to show internal directories.
Click to hide internal directories.