Help us shape the future of Go! Take the 2026 Go Developer Survey

tele

package
v0.230106.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: CC0-1.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNetworkTimeout = 30 * time.Second
)

Variables

This section is empty.

Functions

func New

func New() tele_api.Teler

func NewWithTransporter

func NewWithTransporter(trans Transporter) tele_api.Teler

Types

type CommandCallback

type CommandCallback func(context.Context, []byte) bool

type FromRoboMessage added in v0.220628.0

type FromRoboMessage tele_api.FromRoboMessage

type Transporter

type Transporter interface {
	Init(ctx context.Context, log *log2.Log, teleConfig tele_config.Config, onCommand CommandCallback, messageForRobot CommandCallback) error
	SendState(payload []byte) bool
	SendTelemetry(payload []byte) bool
	SendCommandResponse(topicSuffix string, payload []byte) bool
	SendFromRobot(payload []byte)
	CloseTele()
	RoboConnected() bool
}

Transporter Tele transport contract: - Init fails only with invalid config, ignores network errors - Send* deliver (with retries) within timeout or fail; success includes ack from receiver - hide "connection" concept from upstream API or errors; transport delivers messages at least once - application may start without network available - assume worst network quality: packet loss, reorder, duplicates, corruption

Jump to

Keyboard shortcuts

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