templates

package
v0.0.0-...-5267ef5 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemplateFS embed.FS

This is for sensor templates, but is not used for now: src/*/*/*/*.tpl For example src/extenders/sensors/bosch/bme280.tpl

Functions

This section is empty.

Types

type ClusterCtx

type ClusterCtx struct {
	Endpoint int
	Cluster  cluster.Cluster
}

type Context

type Context struct {
	GeneratedOn time.Time
	Version     string
	// Each sensor will have it's own endpoint,
	// which should be okay for now.
	// Packing multiple sensor into one endpoint
	// can be done in the future.
	Device *config.Device

	Extenders []generator.Extender
}

type ContextWithAdditional

type ContextWithAdditional struct {
	Context
	Extender          generator.Extender
	AdditionalContext any
}

type SensorCtx

type SensorCtx struct {
	Endpoint int
	Sensor   sensor.Sensor
	Device   *config.Device
	Extender generator.Extender
}

type Templates

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

func NewTemplates

func NewTemplates(templateFS fs.FS) *Templates

func (*Templates) WriteTo

func (t *Templates) WriteTo(srcDir string, device *config.Device, extenders []generator.Extender) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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