sketch
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- type InvalidSketchFolderNameError
- type Profile
- type ProfileLibraryReference
- type ProfilePlatformReference
- func (p *ProfilePlatformReference) AsYaml() string
- func (p *ProfilePlatformReference) InternalUniqueIdentifier() string
- func (p *ProfilePlatformReference) RequireSystemInstalledPlatform() bool
- func (p *ProfilePlatformReference) String() string
- func (p *ProfilePlatformReference) UnmarshalYAML(unmarshal func(interface{}) error) error
- type ProfileRequiredLibraries
- type ProfileRequiredPlatforms
- type Project
- type Sketch
- func (s *Sketch) GetDefaultFQBN() string
- func (s *Sketch) GetDefaultPortAddressAndProtocol() (string, string)
- func (s *Sketch) GetDefaultProgrammer() string
- func (s *Sketch) GetProfile(profileName string) (*Profile, error)
- func (s *Sketch) GetProjectPath() *paths.Path
- func (s *Sketch) Hash() string
- func (s *Sketch) SetDefaultFQBN(fqbn string) error
- func (s *Sketch) SetDefaultPort(address, protocol string) error
- func (s *Sketch) SetDefaultProgrammer(programmer string) error
- func (s *Sketch) ToRpc() *rpc.Sketch
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeInvalidSketchFolderNameError¶
type InvalidSketchFolderNameError struct {SketchFolder *paths.PathSketchFile *paths.Path}InvalidSketchFolderNameError is returned when the sketch directory doesn't match the sketch name
func (*InvalidSketchFolderNameError)Error¶
func (e *InvalidSketchFolderNameError) Error()string
typeProfile¶
type Profile struct {NamestringNotesstring `yaml:"notes"`FQBNstring `yaml:"fqbn"`Portstring `yaml:"port"`PortConfig map[string]string `yaml:"port_config"`Protocolstring `yaml:"protocol"`Programmerstring `yaml:"programmer"`PlatformsProfileRequiredPlatforms `yaml:"platforms"`LibrariesProfileRequiredLibraries `yaml:"libraries"`}UnmarshalYAML decodes a Profiles section from YAML source.Profile is a sketch profile, it contains a reference to all the resourcesneeded to build and upload a sketch
func (*Profile)RequireSystemInstalledPlatform¶added inv1.3.0
UsesSystemPlatform checks if this profile requires a system installed platform.
func (*Profile)ToRpc¶
func (p *Profile) ToRpc() *rpc.SketchProfile
ToRpc converts this Profile to an rpc.SketchProfile
typeProfileLibraryReference¶
ProfileLibraryReference is a reference to a library
func (*ProfileLibraryReference)AsYaml¶
func (l *ProfileLibraryReference) AsYaml()string
AsYaml outputs the required library as Yaml
func (*ProfileLibraryReference)InternalUniqueIdentifier¶
func (l *ProfileLibraryReference) InternalUniqueIdentifier()string
InternalUniqueIdentifier returns the unique identifier for this object
func (*ProfileLibraryReference)String¶
func (l *ProfileLibraryReference) String()string
func (*ProfileLibraryReference)UnmarshalYAML¶
func (l *ProfileLibraryReference) UnmarshalYAML(unmarshal func(interface{})error)error
UnmarshalYAML decodes a ProfileLibraryReference from YAML source.
typeProfilePlatformReference¶
type ProfilePlatformReference struct {PackagerstringArchitecturestringVersion *semver.VersionPlatformIndexURL *url.URL}ProfilePlatformReference is a reference to a platform
func (*ProfilePlatformReference)AsYaml¶
func (p *ProfilePlatformReference) AsYaml()string
AsYaml outputs the platform reference as Yaml
func (*ProfilePlatformReference)InternalUniqueIdentifier¶
func (p *ProfilePlatformReference) InternalUniqueIdentifier()string
InternalUniqueIdentifier returns the unique identifier for this object
func (*ProfilePlatformReference)RequireSystemInstalledPlatform¶added inv1.3.0
func (p *ProfilePlatformReference) RequireSystemInstalledPlatform()bool
RequireSystemInstalledPlatform returns true if the platform referencedoes not specify a version, meaning it requires the system installed platform.
func (*ProfilePlatformReference)String¶
func (p *ProfilePlatformReference) String()string
func (*ProfilePlatformReference)UnmarshalYAML¶
func (p *ProfilePlatformReference) UnmarshalYAML(unmarshal func(interface{})error)error
UnmarshalYAML decodes a ProfilePlatformReference from YAML source.
typeProfileRequiredLibraries¶
type ProfileRequiredLibraries []*ProfileLibraryReference
ProfileRequiredLibraries is a list of ProfileLibraryReference (librariesrequired to build the sketch using this profile)
func (*ProfileRequiredLibraries)AsYaml¶
func (p *ProfileRequiredLibraries) AsYaml()string
AsYaml outputs the required libraries as Yaml
typeProfileRequiredPlatforms¶
type ProfileRequiredPlatforms []*ProfilePlatformReference
ProfileRequiredPlatforms is a list of ProfilePlatformReference (platformsrequired to build the sketch using this profile)
func (*ProfileRequiredPlatforms)AsYaml¶
func (p *ProfileRequiredPlatforms) AsYaml()string
AsYaml outputs the required platforms as Yaml
func (*ProfileRequiredPlatforms)UnmarshalYAML¶added inv1.3.0
func (p *ProfileRequiredPlatforms) UnmarshalYAML(unmarshal func(interface{})error)error
typeProject¶
type Project struct {Profiles []*ProfileDefaultProfilestringDefaultFqbnstringDefaultPortstringDefaultPortConfig map[string]stringDefaultProtocolstringDefaultProgrammerstring}Project represents the sketch project file
funcLoadProjectFile¶
LoadProjectFile reads a sketch project file
typeSketch¶
type Sketch struct {NamestringMainFile *paths.PathFullPath *paths.Path// FullPath is the path to the Sketch folderOtherSketchFiles paths.PathList// Sketch files that end in .ino other than main fileAdditionalFiles paths.PathListRootFolderFiles paths.PathList// All files that are in the Sketch rootProject *Project}Sketch holds all the files composing a sketch
funcNew¶
New creates an Sketch instance by reading all the files composing a sketch and grouping themby file type.
func (*Sketch)GetDefaultFQBN¶
GetDefaultFQBN returns the default FQBN for the sketch (from the sketch.yaml project file), or theempty string if not set.
func (*Sketch)GetDefaultPortAddressAndProtocol¶
GetDefaultPortAddressAndProtocol returns the default port address and port protocol for the sketch(from the sketch.yaml project file), or empty strings if not set.
func (*Sketch)GetDefaultProgrammer¶
GetDefaultProgrammer return the default Programmer for the sketch (from the sketch.yaml project file),ore the empty string if not set.
func (*Sketch)GetProfile¶
GetProfile returns the requested profile or an error if not found
func (*Sketch)GetProjectPath¶
func (s *Sketch) GetProjectPath() *paths.Path
GetProjectPath returns the path to the sketch project file (sketch.yaml or sketch.yml)
func (*Sketch)SetDefaultFQBN¶
SetDefaultFQBN sets the default FQBN for the sketch and saves it in the sketch.yaml project file.
func (*Sketch)SetDefaultPort¶
SetDefaultPort sets the default port address and port protocol for the sketch and saves it in thesketch.yaml project file.
func (*Sketch)SetDefaultProgrammer¶
SetDefaultFQBN sets the default programmer for the sketch and saves it in the sketch.yaml project file.