utils

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StartTime time.Time

Functions

func InitLogger

func InitLogger(lstr string, lf string)

func SetLogLevel added in v0.0.8

func SetLogLevel(loglevel string) slog.Level

func SetStation

func SetStation(name string)

func Station

func Station() string

func Timestamp

func Timestamp() time.Duration

Types

type Rando

type Rando struct {
	F float64
}

PeriodicRandomData will collected a new random piece of data every period and transmit it to the given mqtt channel

func NewRando

func NewRando() (r *Rando)

func (Rando) Float64

func (p Rando) Float64() float64

func (Rando) ServeHTTP

func (p Rando) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (Rando) String

func (p Rando) String() interface{}

type Stats

type Stats struct {
	Goroutines int
	CPUs       int
	runtime.MemStats
	GoVersion string
}

func GetStats

func GetStats() *Stats

Jump to

Keyboard shortcuts

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