Documentation
¶
Index ¶
- type ArduinoCli
- func (c *ArduinoCli) Compile(ctx context.Context, req *rpc.CompileRequest, out io.Writer, err io.Writer, ...) (*rpc.CompileResponse, error)
- func (c *ArduinoCli) CreateInstance() *rpc.Instance
- func (c *ArduinoCli) GetPlatforms(req *rpc.PlatformListRequest) ([]*rpc.Platform, error)
- func (c *ArduinoCli) InitSettings(settingsPath string)
- func (c *ArduinoCli) LibraryInstall(ctx context.Context, req *rpc.LibraryInstallRequest, ...) error
- func (c *ArduinoCli) LibraryList(ctx context.Context, req *rpc.LibraryListRequest) (*rpc.LibraryListResponse, error)
- func (c *ArduinoCli) LibrarySearch(ctx context.Context, req *rpc.LibrarySearchRequest) (*rpc.LibrarySearchResponse, error)
- func (c *ArduinoCli) LibraryUninstall(ctx context.Context, req *rpc.LibraryUninstallRequest, tfn rpc.TaskProgressCB) error
- func (c *ArduinoCli) PlatformInstall(ctx context.Context, req *rpc.PlatformInstallRequest, ...) (*rpc.PlatformInstallResponse, error)
- func (c *ArduinoCli) PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse, error)
- func (c *ArduinoCli) PlatformUninstall(ctx context.Context, req *rpc.PlatformUninstallRequest, ...) (*rpc.PlatformUninstallResponse, error)
- func (c *ArduinoCli) UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, fn rpc.DownloadProgressCB) error
- func (c *ArduinoCli) UpdateLibrariesIndex(ctx context.Context, req *rpc.UpdateLibrariesIndexRequest, ...) error
- func (c *ArduinoCli) Version() string
- type BoardWithPort
- type Cli
- type CompileOpts
- type Wrapper
- func (w *Wrapper) AllBoards() []*BoardWithPort
- func (w *Wrapper) ClientVersion() string
- func (w *Wrapper) Compile(opts CompileOpts) error
- func (w *Wrapper) GetInstalledLibs() ([]*rpc.InstalledLibrary, error)
- func (w *Wrapper) GetInstalledPlatforms() ([]*rpc.Platform, error)
- func (w *Wrapper) InstallLibrary(name, version string) (string, error)
- func (w *Wrapper) InstallPlatform(platform string) (string, string, error)
- func (w *Wrapper) SearchLibraries(query string) ([]*rpc.SearchedLibrary, error)
- func (w *Wrapper) SearchPlatforms() ([]*rpc.Platform, error)
- func (w *Wrapper) UninstallLibrary(name string) error
- func (w *Wrapper) UninstallPlatform(platform string) (string, error)
- func (w *Wrapper) UpdateIndexFiles() error
- func (w *Wrapper) UpdateLibraryIndex() error
- func (w *Wrapper) UpdatePlatformIndex() error
- type WrapperOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArduinoCli ¶
type ArduinoCli struct{}
ArduinoCli represents our wrapper around arduino-cli
func NewArduinoCli ¶
func NewArduinoCli() *ArduinoCli
NewArduinoCli returns a new instance of ArduinoCli
func (*ArduinoCli) Compile ¶
func (c *ArduinoCli) Compile(ctx context.Context, req *rpc.CompileRequest, out io.Writer, err io.Writer, cb rpc.TaskProgressCB, verbose bool) (*rpc.CompileResponse, error)
Compile wrapper around arduino-cli Compile
func (*ArduinoCli) CreateInstance ¶
func (c *ArduinoCli) CreateInstance() *rpc.Instance
CreateInstance wrapper around arduino-cli CreateInstance
func (*ArduinoCli) GetPlatforms ¶
func (c *ArduinoCli) GetPlatforms(req *rpc.PlatformListRequest) ([]*rpc.Platform, error)
GetPlatforms wrapper around arduino-cli GetPlatforms
func (*ArduinoCli) InitSettings ¶
func (c *ArduinoCli) InitSettings(settingsPath string)
InitSettings initializes settings from the path to arduino-cli.yaml
func (*ArduinoCli) LibraryInstall ¶
func (c *ArduinoCli) LibraryInstall(ctx context.Context, req *rpc.LibraryInstallRequest, dlfn rpc.DownloadProgressCB, tfn rpc.TaskProgressCB) error
LibraryInstall wrapper around arduino-cli LibraryInstall
func (*ArduinoCli) LibraryList ¶
func (c *ArduinoCli) LibraryList(ctx context.Context, req *rpc.LibraryListRequest) (*rpc.LibraryListResponse, error)
LibraryList wrapper around arduino-cli LibraryList
func (*ArduinoCli) LibrarySearch ¶
func (c *ArduinoCli) LibrarySearch(ctx context.Context, req *rpc.LibrarySearchRequest) (*rpc.LibrarySearchResponse, error)
LibrarySearch wrapper around arduino-cli LibrarySearch
func (*ArduinoCli) LibraryUninstall ¶
func (c *ArduinoCli) LibraryUninstall(ctx context.Context, req *rpc.LibraryUninstallRequest, tfn rpc.TaskProgressCB) error
LibraryUninstall wrapper around arduino-cli LibraryUninstall
func (*ArduinoCli) PlatformInstall ¶
func (c *ArduinoCli) PlatformInstall(ctx context.Context, req *rpc.PlatformInstallRequest, dlfn rpc.DownloadProgressCB, tfn rpc.TaskProgressCB) (*rpc.PlatformInstallResponse, error)
PlatformInstall wrapper around arduino-cli PlatformInstall
func (*ArduinoCli) PlatformSearch ¶
func (c *ArduinoCli) PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse, error)
PlatformSearch wrapper around arduino-cli PlatformSearch
func (*ArduinoCli) PlatformUninstall ¶
func (c *ArduinoCli) PlatformUninstall(ctx context.Context, req *rpc.PlatformUninstallRequest, fn func(curr *rpc.TaskProgress)) (*rpc.PlatformUninstallResponse, error)
PlatformUninstall wrapper around arduino-cli PlatformUninstall
func (*ArduinoCli) UpdateIndex ¶
func (c *ArduinoCli) UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, fn rpc.DownloadProgressCB) error
UpdateIndex wrapper around arduino-cli UpdateIndex
func (*ArduinoCli) UpdateLibrariesIndex ¶
func (c *ArduinoCli) UpdateLibrariesIndex(ctx context.Context, req *rpc.UpdateLibrariesIndexRequest, fn rpc.DownloadProgressCB) error
UpdateLibrariesIndex wrapper around arduino-cli UpdateLibrariesIndex
func (*ArduinoCli) Version ¶
func (c *ArduinoCli) Version() string
Version wrapper around arduino-cli global version
type BoardWithPort ¶
BoardWithPort represents a single arduino Board with associated port
type Cli ¶
type Cli interface {
InitSettings(string)
CreateInstance() *rpc.Instance
UpdateIndex(context.Context, *rpc.UpdateIndexRequest, rpc.DownloadProgressCB) error
UpdateLibrariesIndex(context.Context, *rpc.UpdateLibrariesIndexRequest, rpc.DownloadProgressCB) error
PlatformInstall(context.Context, *rpc.PlatformInstallRequest, rpc.DownloadProgressCB, rpc.TaskProgressCB) (*rpc.PlatformInstallResponse, error)
PlatformUninstall(context.Context, *rpc.PlatformUninstallRequest, func(curr *rpc.TaskProgress)) (*rpc.PlatformUninstallResponse, error)
GetPlatforms(*rpc.PlatformListRequest) ([]*rpc.Platform, error)
PlatformSearch(*rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse, error)
LibrarySearch(context.Context, *rpc.LibrarySearchRequest) (*rpc.LibrarySearchResponse, error)
LibraryInstall(context.Context, *rpc.LibraryInstallRequest, rpc.DownloadProgressCB, rpc.TaskProgressCB) error
LibraryUninstall(context.Context, *rpc.LibraryUninstallRequest, rpc.TaskProgressCB) error
LibraryList(context.Context, *rpc.LibraryListRequest) (*rpc.LibraryListResponse, error)
Compile(context.Context, *rpc.CompileRequest, io.Writer, io.Writer, rpc.TaskProgressCB, bool) (*rpc.CompileResponse, error)
Version() string
}
Cli reprents our wrapper around arduino-cli
type CompileOpts ¶
type CompileOpts struct {
FQBN string
SketchDir string
SketchPath string
BuildProps []string
ShowProps bool
}
CompileOpts represents the options passed to the compile command
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Wrapper our wrapper around the arduino-cli interface
func NewCli ¶
func NewCli(ctx context.Context, settingsPath string, logger *log.Logger, options ...WrapperOption) *Wrapper
NewCli return new arduino-cli wrapper
func (*Wrapper) AllBoards ¶
func (w *Wrapper) AllBoards() []*BoardWithPort
AllBoards returns a list of all supported boards
func (*Wrapper) ClientVersion ¶
ClientVersion returns version of arduino-cli
func (*Wrapper) Compile ¶
func (w *Wrapper) Compile(opts CompileOpts) error
Compile the specified sketch
func (*Wrapper) GetInstalledLibs ¶
func (w *Wrapper) GetInstalledLibs() ([]*rpc.InstalledLibrary, error)
GetInstalledLibs returns a list of installed libraries
func (*Wrapper) GetInstalledPlatforms ¶
GetInstalledPlatforms lists all installed platforms
func (*Wrapper) InstallLibrary ¶
InstallLibrary installs specified version of a library
func (*Wrapper) InstallPlatform ¶
InstallPlatform installs a given platform
func (*Wrapper) SearchLibraries ¶
func (w *Wrapper) SearchLibraries(query string) ([]*rpc.SearchedLibrary, error)
SearchLibraries searches available libraries for download
func (*Wrapper) SearchPlatforms ¶
SearchPlatforms returns specified platform or all platforms if unspecified
func (*Wrapper) UninstallLibrary ¶
UninstallLibrary removes specified library
func (*Wrapper) UninstallPlatform ¶
UninstallPlatform installs a given platform
func (*Wrapper) UpdateIndexFiles ¶
UpdateIndexFiles updates platform and library index files
func (*Wrapper) UpdateLibraryIndex ¶
UpdateLibraryIndex updates library index file
func (*Wrapper) UpdatePlatformIndex ¶
UpdatePlatformIndex updates platform index file
type WrapperOption ¶
type WrapperOption = func(w *Wrapper)
WrapperOption represents and option for the wrapper
func WithArduinoCli ¶
func WithArduinoCli(arduinoCli Cli) WrapperOption
WithArduinoCli allows an injectable arduino cli interface