app

package
v0.0.0-...-bd752d1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMessageTimeout = 10 * time.Second
	IDLen                 = 16
	KeepAliveTimeout      = 100 * time.Millisecond
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Port      int
	Addr      string
	Client    mqtt.Client
	Durations map[string][]time.Duration
	Gateways  []lora.Gateway

	Total int
	Delay time.Duration
	// contains filtered or unexported fields
}

func New

func New(cfg Config) *Application

func (*Application) Connect

func (a *Application) Connect()

func (*Application) Gateway

func (a *Application) Gateway(cfg lora.Config)

func (*Application) PublishSubscribe

func (a *Application) PublishSubscribe()

type Config

type Config struct {
	Port int    `koanf:"port"`
	Addr string `koanf:"addr"`

	Total int           `koanf:"total"`
	Delay time.Duration `koanf:"delay"`
}

type Message

type Message struct {
	ID     uint64
	Delay  time.Duration
	Device string
}

Jump to

Keyboard shortcuts

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