samplestream

package
v0.0.0-...-e8efe0d Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package samplestream provides utilities for creating gNMI Subscriptions in SAMPLE mode.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SampleStream

type SampleStream[T any] struct {
	// contains filtered or unexported fields
}

SampleStream represents a gNMI Subscription with SAMPLE mode.

func New

func New[T any](t *testing.T, dut *ondatra.DUTDevice, q ygnmi.SingletonQuery[T], interval time.Duration) *SampleStream[T]

New creates a new SampleStream.

func (*SampleStream[T]) All

func (s *SampleStream[T]) All() []*ygnmi.Value[T]

All returns the list of values that has been received thus far.

func (*SampleStream[T]) Close

func (s *SampleStream[T]) Close()

Close closes the gnmi subscription.

func (*SampleStream[T]) Next

func (s *SampleStream[T]) Next() *ygnmi.Value[T]

Next returns the next sample received within the sample interval. If no sample is received within the interval, nil is returned.

func (*SampleStream[T]) Nexts

func (s *SampleStream[T]) Nexts(count int) []*ygnmi.Value[T]

Nexts calls Next() count times and returns the slice of returned samples.

Jump to

Keyboard shortcuts

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