Skip to content

CollectAs

func CollectAs[T proto.Message](seq iter.Seq2[[]byte, error]) ([]T, error)

Convert a sequence of bytes into a slice of proto.Message.

Useful to convert the output of Datapoints.Query into a slice of proto.Message.

This a convenience function for Collect(As[T](seq)).

seq iter.Seq2[[]byte, error]

The sequence of bytes to convert

A slice of proto.Message or an error if any.