Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultNetworkTimeout = 30 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
func NewWithTransporter ¶
func NewWithTransporter(trans Transporter) tele_api.Teler
Types ¶
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
Click to show internal directories.
Click to hide internal directories.