Documentation
¶
Index ¶
- type PackageActions
- type PackageManager
- func (pm *PackageManager) Clear()
- func (pm *PackageManager) DownloadPlatformRelease(platform *cores.PlatformRelease) (*downloader.Downloader, error)
- func (pm *PackageManager) DownloadToolRelease(tool *cores.ToolRelease) (*downloader.Downloader, error)
- func (pm *PackageManager) FindBoardWithFQBN(fqbnIn string) (*cores.Board, error)
- func (pm *PackageManager) FindBoardsWithID(id string) []*cores.Board
- func (pm *PackageManager) FindBoardsWithVidPid(vid, pid string) []*cores.Board
- func (pm *PackageManager) FindPlatform(ref *PlatformReference) *cores.Platform
- func (pm *PackageManager) FindPlatformRelease(ref *PlatformReference) *cores.PlatformRelease
- func (pm *PackageManager) FindPlatformReleaseDependencies(item *PlatformReference) (*cores.PlatformRelease, []*cores.ToolRelease, error)
- func (pm *PackageManager) FindPlatformReleaseProvidingBoardsWithVidPid(vid, pid string) []*cores.PlatformRelease
- func (pm *PackageManager) FindToolDependency(dep *cores.ToolDependency) *cores.ToolRelease
- func (pm *PackageManager) FindToolsRequiredForBoard(board *cores.Board) ([]*cores.ToolRelease, error)
- func (pm *PackageManager) GetAllInstalledToolsReleases() []*cores.ToolRelease
- func (pm *PackageManager) GetInstalledPlatformRelease(platform *cores.Platform) *cores.PlatformRelease
- func (pm *PackageManager) GetPackages() *cores.Packages
- func (pm *PackageManager) InstallPlatform(platformRelease *cores.PlatformRelease) error
- func (pm *PackageManager) InstallTool(toolRelease *cores.ToolRelease) error
- func (pm *PackageManager) IsManagedPlatformRelease(platformRelease *cores.PlatformRelease) bool
- func (pm *PackageManager) IsManagedToolRelease(toolRelease *cores.ToolRelease) bool
- func (pm *PackageManager) IsToolRequired(toolRelease *cores.ToolRelease) bool
- func (pm *PackageManager) LoadHardware(config *configs.Configuration) error
- func (pm *PackageManager) LoadHardwareFromDirectories(hardwarePaths paths.PathList) error
- func (pm *PackageManager) LoadHardwareFromDirectory(path *paths.Path) error
- func (pm *PackageManager) LoadPackageIndex(URL *url.URL) error
- func (pm *PackageManager) LoadPackageIndexFromFile(indexPath *paths.Path) (*packageindex.Index, error)
- func (pm *PackageManager) LoadToolsFromBundleDirectories(dirs paths.PathList) error
- func (pm *PackageManager) LoadToolsFromBundleDirectory(toolsPath *paths.Path) error
- func (pm *PackageManager) Package(name string) *PackageActions
- func (pm *PackageManager) ResolveFQBN(fqbn *cores.FQBN) (*cores.Package, *cores.PlatformRelease, *cores.Board, *properties.Map, ...)
- func (pm *PackageManager) UninstallPlatform(platformRelease *cores.PlatformRelease) error
- func (pm *PackageManager) UninstallTool(toolRelease *cores.ToolRelease) error
- type PlatformReference
- type ToolActions
- type ToolReleaseActions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PackageActions ¶
type PackageActions struct {
// contains filtered or unexported fields
}
PackageActions defines what actions can be performed on the specific Package It serves as a status container for the fluent APIs
func (*PackageActions) Tool ¶
func (pa *PackageActions) Tool(name string) *ToolActions
Tool looks for the Tool with the given name, returning a structure able to perform further operations on that given resource
type PackageManager ¶
type PackageManager struct { Log logrus.FieldLogger IndexDir *paths.Path PackagesDir *paths.Path DownloadDir *paths.Path TempDir *paths.Path // contains filtered or unexported fields }
PackageManager defines the superior oracle which understands all about Arduino Packages, how to parse them, download, and so on.
The manager also keeps track of the status of the Packages (their Platform Releases, actually) installed in the system.
func NewPackageManager ¶
func NewPackageManager(indexDir, packagesDir, downloadDir, tempDir *paths.Path) *PackageManager
NewPackageManager returns a new instance of the PackageManager
func (*PackageManager) Clear ¶
func (pm *PackageManager) Clear()
func (*PackageManager) DownloadPlatformRelease ¶
func (pm *PackageManager) DownloadPlatformRelease(platform *cores.PlatformRelease) (*downloader.Downloader, error)
DownloadPlatformRelease downloads a PlatformRelease. If the platform is already downloaded a nil Downloader is returned.
func (*PackageManager) DownloadToolRelease ¶
func (pm *PackageManager) DownloadToolRelease(tool *cores.ToolRelease) (*downloader.Downloader, error)
DownloadToolRelease downloads a ToolRelease. If the tool is already downloaded a nil Downloader is returned.
func (*PackageManager) FindBoardWithFQBN ¶
func (pm *PackageManager) FindBoardWithFQBN(fqbnIn string) (*cores.Board, error)
FindBoardWithFQBN returns the board identified by the fqbn, or an error
func (*PackageManager) FindBoardsWithID ¶
func (pm *PackageManager) FindBoardsWithID(id string) []*cores.Board
func (*PackageManager) FindBoardsWithVidPid ¶
func (pm *PackageManager) FindBoardsWithVidPid(vid, pid string) []*cores.Board
func (*PackageManager) FindPlatform ¶
func (pm *PackageManager) FindPlatform(ref *PlatformReference) *cores.Platform
FindPlatform returns the Platform matching the PlatformReference or nil if not found. The PlatformVersion field of the reference is ignored.
func (*PackageManager) FindPlatformRelease ¶
func (pm *PackageManager) FindPlatformRelease(ref *PlatformReference) *cores.PlatformRelease
FindPlatformRelease returns the PlatformRelease matching the PlatformReference or nil if not found
func (*PackageManager) FindPlatformReleaseDependencies ¶
func (pm *PackageManager) FindPlatformReleaseDependencies(item *PlatformReference) (*cores.PlatformRelease, []*cores.ToolRelease, error)
FindPlatformReleaseDependencies takes a PlatformReference and returns a set of items to download and a set of outputs for non existing platforms.
func (*PackageManager) FindPlatformReleaseProvidingBoardsWithVidPid ¶
func (pm *PackageManager) FindPlatformReleaseProvidingBoardsWithVidPid(vid, pid string) []*cores.PlatformRelease
func (*PackageManager) FindToolDependency ¶
func (pm *PackageManager) FindToolDependency(dep *cores.ToolDependency) *cores.ToolRelease
func (*PackageManager) FindToolsRequiredForBoard ¶
func (pm *PackageManager) FindToolsRequiredForBoard(board *cores.Board) ([]*cores.ToolRelease, error)
func (*PackageManager) GetAllInstalledToolsReleases ¶
func (pm *PackageManager) GetAllInstalledToolsReleases() []*cores.ToolRelease
func (*PackageManager) GetInstalledPlatformRelease ¶
func (pm *PackageManager) GetInstalledPlatformRelease(platform *cores.Platform) *cores.PlatformRelease
GetInstalledPlatformRelease returns the PlatformRelease installed (it is chosen)
func (*PackageManager) GetPackages ¶
func (pm *PackageManager) GetPackages() *cores.Packages
func (*PackageManager) InstallPlatform ¶
func (pm *PackageManager) InstallPlatform(platformRelease *cores.PlatformRelease) error
InstallPlatform installs a specific release of a platform.
func (*PackageManager) InstallTool ¶
func (pm *PackageManager) InstallTool(toolRelease *cores.ToolRelease) error
InstallTool installs a specific release of a tool.
func (*PackageManager) IsManagedPlatformRelease ¶
func (pm *PackageManager) IsManagedPlatformRelease(platformRelease *cores.PlatformRelease) bool
IsManagedPlatformRelease returns true if the PlatforRelease is managed by the PackageManager
func (*PackageManager) IsManagedToolRelease ¶
func (pm *PackageManager) IsManagedToolRelease(toolRelease *cores.ToolRelease) bool
IsManagedToolRelease returns true if the ToolRelease is managed by the PackageManager
func (*PackageManager) IsToolRequired ¶
func (pm *PackageManager) IsToolRequired(toolRelease *cores.ToolRelease) bool
IsToolRequired returns true if any of the installed platforms requires the toolRelease passed as parameter
func (*PackageManager) LoadHardware ¶
func (pm *PackageManager) LoadHardware(config *configs.Configuration) error
LoadHardware read all plaforms from the configured paths
func (*PackageManager) LoadHardwareFromDirectories ¶
func (pm *PackageManager) LoadHardwareFromDirectories(hardwarePaths paths.PathList) error
LoadHardwareFromDirectories load plaforms from a set of directories
func (*PackageManager) LoadHardwareFromDirectory ¶
func (pm *PackageManager) LoadHardwareFromDirectory(path *paths.Path) error
LoadHardwareFromDirectory read a plaform from the path passed as parameter
func (*PackageManager) LoadPackageIndex ¶
func (pm *PackageManager) LoadPackageIndex(URL *url.URL) error
LoadPackageIndex loads a package index by looking up the local cached file from the specified URL
func (*PackageManager) LoadPackageIndexFromFile ¶
func (pm *PackageManager) LoadPackageIndexFromFile(indexPath *paths.Path) (*packageindex.Index, error)
LoadPackageIndexFromFile load a package index from the specified file
func (*PackageManager) LoadToolsFromBundleDirectories ¶
func (pm *PackageManager) LoadToolsFromBundleDirectories(dirs paths.PathList) error
func (*PackageManager) LoadToolsFromBundleDirectory ¶
func (pm *PackageManager) LoadToolsFromBundleDirectory(toolsPath *paths.Path) error
func (*PackageManager) Package ¶
func (pm *PackageManager) Package(name string) *PackageActions
Package looks for the Package with the given name, returning a structure able to perform further operations on that given resource
func (*PackageManager) ResolveFQBN ¶
func (pm *PackageManager) ResolveFQBN(fqbn *cores.FQBN) ( *cores.Package, *cores.PlatformRelease, *cores.Board, *properties.Map, *cores.PlatformRelease, error)
ResolveFQBN returns, in order:
- the Package pointed by the fqbn
- the PlatformRelease pointed by the fqbn
- the Board pointed by the fqbn
- the build properties for the board considering also the configuration part of the fqbn
- the PlatformRelease to be used for the build (if the board requires a 3rd party core it may be different from the PlatformRelease pointed by the fqbn)
- an error if any of the above is not found
In case of error the partial results found in the meantime are returned together with the error.
func (*PackageManager) UninstallPlatform ¶
func (pm *PackageManager) UninstallPlatform(platformRelease *cores.PlatformRelease) error
UninstallPlatform remove a PlatformRelease.
func (*PackageManager) UninstallTool ¶
func (pm *PackageManager) UninstallTool(toolRelease *cores.ToolRelease) error
UninstallTool remove a ToolRelease.
type PlatformReference ¶
type PlatformReference struct { Package string // The package where this Platform belongs to. PlatformArchitecture string PlatformVersion *semver.Version }
PlatformReference represents a tuple to identify a Platform
func (*PlatformReference) String ¶
func (platform *PlatformReference) String() string
type ToolActions ¶
type ToolActions struct {
// contains filtered or unexported fields
}
ToolActions defines what actions can be performed on the specific Tool It serves as a status container for the fluent APIs
func (*ToolActions) Get ¶
func (ta *ToolActions) Get() (*cores.Tool, error)
Get returns the final representation of the Tool
func (*ToolActions) IsInstalled ¶
func (ta *ToolActions) IsInstalled() (bool, error)
IsInstalled checks whether any release of the Tool is installed in the system
func (*ToolActions) Release ¶
func (ta *ToolActions) Release(version *semver.RelaxedVersion) *ToolReleaseActions
type ToolReleaseActions ¶
type ToolReleaseActions struct {
// contains filtered or unexported fields
}
ToolReleaseActions defines what actions can be performed on the specific ToolRelease It serves as a status container for the fluent APIs
func (*ToolReleaseActions) Get ¶
func (tr *ToolReleaseActions) Get() (*cores.ToolRelease, error)