providers

package
v0.0.0-...-89602ce Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: BSD-3-Clause Imports: 16 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MconfigProvider

type MconfigProvider struct{}

MconfigProvider provides streamer mconfigs (magma configs).

func (*MconfigProvider) GetStreamName

func (p *MconfigProvider) GetStreamName() string

func (*MconfigProvider) GetUpdates

func (p *MconfigProvider) GetUpdates(gatewayId string, extraArgs *any.Any) ([]*protos.DataUpdate, error)

type StreamProvider

type StreamProvider interface {
	// GetStreamName returns the name of the stream that this provider
	// services. This name must be globally unique.
	GetStreamName() string

	// GetUpdates returns updates to stream updates back to a gateway given its hardware ID
	// If GetUpdates returns error, the stream will be closed without sending any updates
	// If GetUpdates returns error == nil, updates will be sent & the stream will be closed after that
	// If GetUpdates returns error == io.EAGAIN - the returned updates will be sent & GetUpdates will be called again
	// on the same stream
	GetUpdates(gatewayId string, extraArgs *any.Any) ([]*protos.DataUpdate, error)
}

StreamProvider provides a streamer policy. Given a gateway hardware ID, return a serialized data bundle of updates to stream back to the gateway.

func GetStreamProvider

func GetStreamProvider(streamName string) (StreamProvider, error)

GetStreamProvider gets the stream provider for a stream name. Returns an error if no provider has been registered for the stream.

func NewRemoteProvider

func NewRemoteProvider(serviceName, stream string) StreamProvider

NewRemoteProvider returns a stream provider that forwards its methods to the remote stream provider servicer.

Jump to

Keyboard shortcuts

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