apitools

package
v4.1.12 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: BSD-2-Clause Imports: 9 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithAuth

func ContextWithAuth(token string, timeout time.Duration) (ctx context.Context, done func())

ContextWithAuth returns a context with the API token set

Types

type DataStream

type DataStream interface {
	Recv() (spanapi.OutputDataMessage, error)
	Close() error
}

DataStream is a stream of data from the Span service. The data stream uses a websocket under the hood.

func NewCollectionDataStream

func NewCollectionDataStream(ctx context.Context, config *spanapi.Configuration, collectionID string) (DataStream, error)

NewCollectionDataStream creates a live data stream for devices in a collection. The context must contain the appropriate credentials.

func NewDeviceDataStream

func NewDeviceDataStream(ctx context.Context, config *spanapi.Configuration, collectionID, deviceID string) (DataStream, error)

NewDeviceDataStream creates a live data stream for a single device. The context must contain the appropriate credentials.

Jump to

Keyboard shortcuts

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