transport

package
v0.0.0-...-84ed8a2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTransport

func AddTransport(transport Transport) error

AddTransport adds new transport into registry

func DeleteTransport

func DeleteTransport(name string) error

DeleteTransport deletes previously registered transport.

func LoadTransports

func LoadTransports(reader io.Reader) error

LoadTransports reads and parses YAML configuration from file

func MustAddTransportType

func MustAddTransportType(typeName string, f transportCreateFunc)

MustAddTransportType register new transport type

func SaveTransports

func SaveTransports(writer io.Writer) error

SaveTransports writes all registered transports in YAML format using writer

Types

type Transport

type Transport interface {
	GetName() string
	GetTypeName() string
	Start() error
	Stop()

	Receive() <-chan []byte
	Send([]byte) error
}

Transport represent a OpenIoT transport layer, e.g. UDP, TCP, USB, etc

func FindTransportByName

func FindTransportByName(name string) Transport

FindTransportByName lookups device by name. Returns nil if not found.

func GetAllTransports

func GetAllTransports() []Transport

GetAllTransports returns all registered transports

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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