devicetemplates

package
v3.32.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package devicetemplates implements creating templates for devices.

Index

Constants

View Source
const TTSCSV = "the-things-stack-csv"

TTSCSV is the device template converter ID.

View Source
const TTSJSON = "the-things-stack"

TTSJSON is the device template converter ID.

Variables

This section is empty.

Functions

func NewContextWithProfileIDs added in v3.21.2

func NewContextWithProfileIDs(ctx context.Context, ids *ttnpb.EndDeviceVersionIdentifiers) context.Context

NewContextWithProfileIDs returns a context with an EndDeviceVersionIdentifiers injected into it.

func ProfileIDsFromContext added in v3.21.2

func ProfileIDsFromContext(ctx context.Context) *ttnpb.EndDeviceVersionIdentifiers

ProfileIDsFromContext fetches an EndDeviceVersionIdentifiers from within the given context, nil if does not exist.

func RegisterConverter

func RegisterConverter(id string, c Converter)

RegisterConverter registers the given converter. Existing registrations with the same ID will be overwritten. This function is not goroutine-safe.

Types

type Converter

type Converter interface {
	Format() *ttnpb.EndDeviceTemplateFormat
	Convert(context.Context, io.Reader, func(*ttnpb.EndDeviceTemplate) error) error
}

Converter converts a binary file in end device templates.

func GetConverter

func GetConverter(id string) Converter

GetConverter returns the converter by ID.

Jump to

Keyboard shortcuts

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