commands

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(req *rpc.CreateRequest, extraUserAgent ...string) (*rpc.CreateResponse, error)

Create a new CoreInstance ready to be initialized, supporting directories are also created.

func Destroy

func Destroy(ctx context.Context, req *rpc.DestroyRequest) (*rpc.DestroyResponse, error)

Destroy FIXMEDOC

func GetLibraryManager added in v0.0.2

func GetLibraryManager(req rpc.InstanceCommand) *librariesmanager.LibrariesManager

GetLibraryManager returns the library manager for the given instance.

func GetPackageManager added in v0.0.2

func GetPackageManager(instance rpc.InstanceCommand) *packagemanager.PackageManager

GetPackageManager returns a PackageManager. If the package manager is not found (because the instance is invalid or has been destroyed), nil is returned. Deprecated: use GetPackageManagerExplorer instead.

func GetPackageManagerExplorer added in v0.0.2

func GetPackageManagerExplorer(req rpc.InstanceCommand) (explorer *packagemanager.Explorer, release func())

GetPackageManagerExplorer returns a new package manager Explorer. The explorer holds a read lock on the underlying PackageManager and it should be released by calling the returned "release" function.

func Init

func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) error

Init loads installed libraries and Platforms in CoreInstance with specified ID, a gRPC status error is returned if the CoreInstance doesn't exist. All responses are sent through responseCallback, can be nil to ignore all responses. Failures don't stop the loading process, in case of loading failure the Platform or library is simply skipped and an error gRPC status is sent to responseCallback.

func ParseVersion

func ParseVersion(req Versioned) (*semver.Version, error)

ParseVersion returns the version parsed from an interface that provides the GetVersion() method (interface Versioned)

func PlatformReleaseToRPC

func PlatformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.Platform

PlatformReleaseToRPC converts our inter structure to the RPC structure. Note: this function does not touch the "Installed" field of rpc.Platform as it's not always clear that the platformRelease we're currently converting is actually installed.

func UpdateIndex

func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB rpc.DownloadProgressCB) error

UpdateIndex FIXMEDOC

func UpdateLibrariesIndex

func UpdateLibrariesIndex(ctx context.Context, req *rpc.UpdateLibrariesIndexRequest, downloadCB rpc.DownloadProgressCB) error

UpdateLibrariesIndex updates the library_index.json

Types

type CoreInstance added in v0.0.2

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

CoreInstance is an instance of the Arduino Core Services. The user can instantiate as many as needed by providing a different configuration for each one.

type Versioned

type Versioned interface {
	GetVersion() string
}

Versioned is an object that provides a GetVersion() method

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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