udp

package module
v0.0.0-...-9849d96 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 4 Imported by: 0

README

udp

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator generates payloads based on a configuration.

func NewGenerator

func NewGenerator(interval int) Generator

NewGenerator returns a new Generator.

func (Generator) Generate

func (g Generator) Generate(ctx context.Context, sendChan chan<- Payload)

Generate generates Payloads with random data and sends them over the sendChan.

type Payload

type Payload struct {
	DeviceID    string `json:"device_id"`
	Temperature int    `json:"temperature"`
}

func (Payload) String

func (p Payload) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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