apitools

package
v4.1.14 Latest Latest
Warning

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

Go to latest
Published: May 6, 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) context.Context

ContextWithAuth returns a context with the API token set

func ContextWithAuthAndTimeout added in v4.1.14

func ContextWithAuthAndTimeout(token string, timeout time.Duration) (context.Context, func())

ContextWithAuthAndTimeout returns a context with the API token set and timeout

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