modulegen

package
v0.58.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package modulegen contains defined types used for module generation

Index

Constants

This section is empty.

Variables

View Source
var Resources = []string{
	"arm component",
	"audio_input component",
	"base component",
	"board component",
	"camera component",
	"encoder component",
	"gantry component",
	"generic component",
	"gripper component",
	"input component",
	"motor component",
	"movement_sensor component",
	"pose_tracker component",
	"power_sensor component",
	"sensor component",
	"servo component",
	"generic service",
	"mlmodel service",
	"motion service",
	"navigation service",
	"slam service",
	"vision service",
}

Resources is a list of all the available resources in Viam.

Functions

This section is empty.

Types

type GoModuleTmpl

type GoModuleTmpl struct {
	Module    ModuleInputs
	ModelType string
	ObjName   string
	Imports   string
	Functions string
}

GoModuleTmpl contains necessary information to fill out the go method stubs.

type ModuleInputs

type ModuleInputs struct {
	ModuleName       string    `json:"module_name"`
	IsPublic         bool      `json:"-"`
	Namespace        string    `json:"namespace"`
	OrgID            string    `json:"-"`
	Language         string    `json:"language"`
	Resource         string    `json:"-"`
	ResourceType     string    `json:"resource_type"`
	ResourceSubtype  string    `json:"resource_subtype"`
	ModelName        string    `json:"model_name"`
	EnableCloudBuild bool      `json:"enable_cloud_build"`
	InitializeGit    bool      `json:"initialize_git"`
	RegisterOnApp    bool      `json:"-"`
	GeneratorVersion string    `json:"generator_version"`
	GeneratedOn      time.Time `json:"generated_on"`

	ModulePascal          string `json:"-"`
	ModuleCamel           string `json:"-"`
	ModuleLowercase       string `json:"-"`
	API                   string `json:"-"`
	ResourceSubtypePascal string `json:"-"`
	ResourceTypePascal    string `json:"-"`
	ModelPascal           string `json:"-"`
	ModelCamel            string `json:"-"`
	ModelTriple           string `json:"-"`
	ModelLowercase        string `json:"-"`

	SDKVersion string `json:"-"`
}

ModuleInputs contains the necessary information to fill out template files.

func (*ModuleInputs) CheckResource

func (inputs *ModuleInputs) CheckResource() error

CheckResource checks if the given resource is valid.

func (*ModuleInputs) HasEmptyInput

func (inputs *ModuleInputs) HasEmptyInput() bool

HasEmptyInput checks to see if any required inputs were not filled in.

Jump to

Keyboard shortcuts

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