bricks

package
v0.8.0-rc.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBrickNotFound   = errors.New("brick not found")
	ErrCannotSaveBrick = errors.New("cannot save brick instance")
)

Functions

This section is empty.

Types

type AIModel added in v0.7.0

type AIModel struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type AppBrickInstancesResult

type AppBrickInstancesResult struct {
	BrickInstances []BrickInstanceListItem `json:"bricks"`
}

type AppReference

type AppReference struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Icon string `json:"icon"`
}

type BrickConfigVariable added in v0.6.7

type BrickConfigVariable struct {
	Name        string `json:"name"`
	Value       string `json:"value"`
	Description string `json:"description"`
	Required    bool   `json:"required"`
}

type BrickCreateUpdateRequest

type BrickCreateUpdateRequest struct {
	ID        string            `json:"-"`
	Model     *string           `json:"model"`
	Variables map[string]string `json:"variables,omitempty"`
}

type BrickDetailsResult

type BrickDetailsResult struct {
	ID               string                   `json:"id"`
	Name             string                   `json:"name"`
	Author           string                   `json:"author"`
	Description      string                   `json:"description"`
	Category         string                   `json:"category"`
	Status           string                   `json:"status"`
	RequireModel     bool                     `json:"require_model"`
	Variables        map[string]BrickVariable `` /* 129-byte string literal not displayed */
	Readme           string                   `json:"readme"`
	ApiDocsPath      string                   `json:"api_docs_path"`
	CodeExamples     []CodeExample            `json:"code_examples"`
	UsedByApps       []AppReference           `json:"used_by_apps"`
	CompatibleModels []AIModel                `json:"compatible_models"`
	ConfigVariables  []BrickConfigVariable    `json:"config_variables"`
}

type BrickInstance

type BrickInstance struct {
	ID               string                `json:"id"`
	Name             string                `json:"name"`
	Author           string                `json:"author"`
	Category         string                `json:"category"`
	Status           string                `json:"status"`
	Variables        map[string]string     `` /* 129-byte string literal not displayed */
	ConfigVariables  []BrickConfigVariable `json:"config_variables,omitempty"`
	RequireModel     bool                  `json:"require_model"`
	ModelID          string                `json:"model,omitempty"`
	CompatibleModels []AIModel             `json:"compatible_models"`
}

type BrickInstanceListItem added in v0.7.0

type BrickInstanceListItem struct {
	ID              string                `json:"id"`
	Name            string                `json:"name"`
	Author          string                `json:"author"`
	Category        string                `json:"category"`
	Status          string                `json:"status"`
	Variables       map[string]string     `` /* 129-byte string literal not displayed */
	ConfigVariables []BrickConfigVariable `json:"config_variables,omitempty"`
	RequireModel    bool                  `json:"require_model"`
	ModelID         string                `json:"model,omitempty"`
}

type BrickListItem

type BrickListItem struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Author       string `json:"author"`
	Description  string `json:"description"`
	Category     string `json:"category"`
	Status       string `json:"status"`
	RequireModel bool   `json:"require_model"`
}

type BrickListResult

type BrickListResult struct {
	Bricks []BrickListItem `json:"bricks"`
}

type BrickVariable

type BrickVariable struct {
	DefaultValue string `json:"default_value,omitempty"`
	Description  string `json:"description,omitempty"`
	Required     bool   `json:"required"`
}

type CodeExample

type CodeExample struct {
	Path string `json:"path"`
}

type Service

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

func NewService

func NewService(
	modelsIndex *modelsindex.ModelsIndex,
	bricksIndex *bricksindex.BricksIndex,
	staticStore *store.StaticStore,
) *Service

func (*Service) AppBrickInstanceDetails

func (s *Service) AppBrickInstanceDetails(a *app.ArduinoApp, brickID string) (BrickInstance, error)

func (*Service) AppBrickInstancesList

func (s *Service) AppBrickInstancesList(a *app.ArduinoApp) (AppBrickInstancesResult, error)

func (*Service) BrickCreate

func (s *Service) BrickCreate(
	req BrickCreateUpdateRequest,
	appCurrent app.ArduinoApp,
) error

func (*Service) BrickDelete

func (s *Service) BrickDelete(
	appCurrent *app.ArduinoApp,
	id string,
) error

func (*Service) BrickUpdate

func (s *Service) BrickUpdate(
	req BrickCreateUpdateRequest,
	appCurrent app.ArduinoApp,
) error

func (*Service) BricksDetails

func (s *Service) BricksDetails(id string, idProvider *app.IDProvider,
	cfg config.Configuration) (BrickDetailsResult, error)

func (*Service) List

func (s *Service) List() (BrickListResult, error)

Jump to

Keyboard shortcuts

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