template

package
v0.0.0-...-88d6d00 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromDashboard

func FromDashboard(dashboard *iotclient.ArduinoDashboardv2) map[string]interface{}

FromDashboard extracts a template of type map[string]interface{} from a dashboard.

func FromThing

func FromThing(thing *iotclient.ArduinoThing) map[string]interface{}

FromThing extracts a template of type map[string]interface{} from a thing.

func LoadDashboard

func LoadDashboard(ctx context.Context, file string, override map[string]string, thinger ThingFetcher) (*iotclient.Dashboardv2, error)

LoadDashboard loads a dashboard from a dashboard template file. It applies the thing overrides specified by the override parameter. It requires a ThingFetcher to retrieve the actual variable ids.

func LoadThing

func LoadThing(file string) (*iotclient.ThingCreate, error)

LoadThing loads a thing from a thing template file.

func ToFile

func ToFile(template map[string]interface{}, outfile string, format string) error

ToFile takes a generic template and saves it into a file, in the specified format (yaml or json).

Types

type ThingFetcher

type ThingFetcher interface {
	ThingShow(ctx context.Context, id string) (*iotclient.ArduinoThing, error)
}

ThingFetcher wraps the method to fetch a thing given its id.

Jump to

Keyboard shortcuts

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