aggregator

package
v0.23.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aggregate

func Aggregate[T any](dst, src T)

Aggregate aggregates src and dst into dst using reflection where T should be a pointer to a struct, otherwise, it panics. The logic depends on the prefix of the Field's Name; If it starts with:

  • "Total": sum of the two values.
  • "Max" or "EnhancedMax": max value between the two values.
  • "Min" or "EnhancedMin": min value between the two values.
  • "Avg" or "EnhancedAvg": avg of the two values.
  • "Num" and ends with "s": sum of the two values. (e.g. NumSplits, NumLaps, NumSessions)
  • Otherwise: fill with src's Value only if dst's Value is invalid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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