app

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidApp = fmt.Errorf("invalid app")
View Source
var ErrInvalidID = errors.New("not a valid id")

Functions

This section is empty.

Types

type AppDescriptor

type AppDescriptor struct {
	Name            string   `yaml:"name"`
	Description     string   `yaml:"description"`
	Ports           []int    `yaml:"ports"`
	Bricks          []Brick  `yaml:"bricks"`
	Icon            string   `yaml:"icon,omitempty"`
	RequiredDevices []string `yaml:"required_devices,omitempty"`
}

func ParseDescriptorFile

func ParseDescriptorFile(file *paths.Path) (AppDescriptor, error)

ParseAppFile reads an app file

func (*AppDescriptor) IsValid

func (a *AppDescriptor) IsValid() error

func (AppDescriptor) MarshalYAML

func (d AppDescriptor) MarshalYAML() (any, error)

type ArduinoApp

type ArduinoApp struct {
	Name           string
	MainPythonFile *paths.Path
	MainSketchPath *paths.Path
	FullPath       *paths.Path // FullPath is the path to the App folder
	Descriptor     AppDescriptor
}

ArduinoApp holds all the files composing an app

func Load

func Load(appPath string) (ArduinoApp, error)

Load creates an App instance by reading all the files composing an app and grouping them by file type.

func (*ArduinoApp) AppComposeFilePath

func (a *ArduinoApp) AppComposeFilePath() *paths.Path

func (*ArduinoApp) AppComposeOverrideFilePath

func (a *ArduinoApp) AppComposeOverrideFilePath() *paths.Path

func (*ArduinoApp) GetDescriptorPath

func (a *ArduinoApp) GetDescriptorPath() *paths.Path

GetDescriptorPath returns the path to the app descriptor file (app.yaml or app.yml)

func (*ArduinoApp) ProvisioningStateDir

func (a *ArduinoApp) ProvisioningStateDir() *paths.Path

func (*ArduinoApp) Save

func (a *ArduinoApp) Save() error

func (*ArduinoApp) SketchBuildPath

func (a *ArduinoApp) SketchBuildPath() *paths.Path

type Brick

type Brick struct {
	ID        string            `yaml:"-"` // Ignores this field, to be handled manually
	Model     string            `yaml:"model,omitempty"`
	Variables map[string]string `yaml:"variables,omitempty"`
}

func (*Brick) UnmarshalYAML

func (md *Brick) UnmarshalYAML(node ast.Node) error

type ID

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

func (ID) Equal

func (id ID) Equal(other ID) bool

Equal implements the go-cmp equality interface.

func (ID) IsApp

func (id ID) IsApp() bool

func (ID) IsExample

func (id ID) IsExample() bool

func (ID) MarshalJSON

func (id ID) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for ID.

func (ID) String

func (id ID) String() string

func (ID) ToPath

func (id ID) ToPath() *paths.Path

type IDProvider

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

func NewAppIDProvider

func NewAppIDProvider(cfg config.Configuration) *IDProvider

func (*IDProvider) IDFromBase64

func (p *IDProvider) IDFromBase64(id string) (ID, error)

func (*IDProvider) IDFromPath

func (p *IDProvider) IDFromPath(path *paths.Path) (ID, error)

func (*IDProvider) ParseID

func (p *IDProvider) ParseID(id string) (ID, error)

ParseID parses a string into an ID. It accepts both absolute paths and relative paths.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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