Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Accumulate ¶
type Accumulate[T Numeric] struct{}
Accumulate adds each value to a running total. Requires T to support the + operator (int, int64, float64, etc.).
func NewAccumulate ¶
func NewAccumulate[T Numeric]() *Accumulate[T]
NewAccumulate creates a transform that accumulates values.
func (*Accumulate[T]) Apply ¶
func (t *Accumulate[T]) Apply(incoming T, state State[T]) T
Apply adds the incoming value to the current state and returns the new total.
func (*Accumulate[T]) Name ¶
func (t *Accumulate[T]) Name() string
Name returns the transform identifier.
type Numeric ¶
type Numeric interface {
~int | ~int8 | ~int16 | ~int32 | ~int64 |
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 |
~float32 | ~float64
}
Numeric defines types that support arithmetic operations.
type State ¶
type State[T any] interface { GetState() T }
State provides read-only access to current state.
type Transformation ¶
Transformation modifies a value.
Click to show internal directories.
Click to hide internal directories.