merge

package
v0.2024.5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EarliestTimestamp

func EarliestTimestamp[E any](items []E, f func(E) *timestamppb.Timestamp) *timestamppb.Timestamp

func Int32Attributes added in v0.2024.5

func Int32Attributes[E any](all []E, fn func(E) *types.Int32Attributes) *types.Int32Attributes

func Int32Bounds added in v0.2024.5

func Int32Bounds[E any](items []E, f func(E) *types.Int32Bounds) *types.Int32Bounds

func LatestTimestamp

func LatestTimestamp[E any](items []E, f func(E) *timestamppb.Timestamp) *timestamppb.Timestamp

func Max

func Max[N Number, E any](items []E, f func(E) (N, bool)) (N, bool)

func MaxDuration added in v0.2024.5

func MaxDuration[E any](items []E, f func(E) *durationpb.Duration) *durationpb.Duration

MaxDuration returns the maximum duration from the given items.

func Mean

func Mean[N Number, E any](items []E, f func(E) (N, bool)) (N, bool)

func Mode

func Mode[N Number, E any](items []E, f func(E) (N, bool)) (N, bool)

func Ptr

func Ptr[T any](v T, ok bool) *T

func ResourceSupport added in v0.2024.5

func ResourceSupport[E any](all []E, fn func(E) *types.ResourceSupport) *types.ResourceSupport

ResourceSupport merges all ResourceSupport values into a single ResourceSupport. If any item is readable, the result will be readable, similarly for writable and observable. If any items disagree on PullSupport, the result will be PULL_SUPPORT_UNSPECIFIED. PullPoll is the maximum of all PullPoll values.

func Sum

func Sum[N Number, E any](items []E, f func(E) (N, bool)) (N, bool)

Types

type Number

type Number interface {
	constraints.Float | constraints.Integer
}

Jump to

Keyboard shortcuts

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