Documentation
¶
Index ¶
- type DB
- func (db *DB) AddLibrary(library *Library) error
- func (db *DB) AddRelease(release *Release, repoURL string) error
- func (db *DB) Commit() error
- func (db *DB) FindLibrary(libraryName string) (*Library, error)
- func (db *DB) FindRelease(release *Release) (*Release, error)
- func (db *DB) FindReleasesOfLibrary(lib *Library) []*Release
- func (db *DB) HasLibrary(libraryName string) bool
- func (db *DB) HasRelease(release *Release) bool
- func (db *DB) HasReleaseByNameVersion(libraryName string, libraryVersion string) bool
- func (db *DB) OutputLibraryIndex() (interface{}, error)
- func (db *DB) RemoveLibrary(libraryName string) error
- func (db *DB) RemoveReleaseByNameVersion(libraryName string, libraryVersion string) error
- func (db *DB) RemoveReleases(libraryName string) error
- func (db *DB) Save(r io.Writer) error
- func (db *DB) SaveToFile() error
- type Dependency
- type Library
- type Release
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct { Libraries []*Library Releases []*Release // contains filtered or unexported fields }
DB is the libraries database
func LoadFromFile ¶
LoadFromFile returns a DB object loaded from the given filename.
func (*DB) AddLibrary ¶
AddLibrary adds a library to the database.
func (*DB) AddRelease ¶
AddRelease adds a library release to the database.
func (*DB) FindLibrary ¶
FindLibrary returns the Library object for the given name.
func (*DB) FindRelease ¶
FindRelease returns the Release object from the database that matches the given object.
func (*DB) FindReleasesOfLibrary ¶
FindReleasesOfLibrary returns the database's releases for the given Library object.
func (*DB) HasLibrary ¶
HasLibrary returns whether the database already contains the given library.
func (*DB) HasRelease ¶
HasRelease returns whether the database already contains the given Release object.
func (*DB) HasReleaseByNameVersion ¶
HasReleaseByNameVersion returns whether the database contains a release for the given library and version number.
func (*DB) OutputLibraryIndex ¶
OutputLibraryIndex generates an object that once JSON-marshaled produces a json file suitable for the library installer (i.e. produce a valid library_index.json file)
func (*DB) RemoveLibrary ¶
RemoveLibrary removes a library and all its releases from the database.
func (*DB) RemoveReleaseByNameVersion ¶
RemoveReleaseByNameVersion removes the given library release from the database.
func (*DB) RemoveReleases ¶
RemoveReleases removes all releases of a library from the database.
type Dependency ¶
Dependency is a library dependency
func ExtractDependenciesList ¶
func ExtractDependenciesList(depends string) ([]*Dependency, error)
ExtractDependenciesList extracts dependencies from the "depends" field of library.properties
type Library ¶
type Library struct { Name string Repository string // Category of the latest release of the library LatestCategory string }
Library is an Arduino library
type Release ¶
type Release struct { LibraryName string // The library name Version Version Author string Maintainer string License string Sentence string Paragraph string Website string Category string Architectures []string Types []string URL string ArchiveFileName string Size int64 Checksum string Includes []string Dependencies []*Dependency Log string }
Release is a library release
func FromLibraryToRelease ¶
func FromLibraryToRelease(library *metadata.LibraryMetadata) *Release
FromLibraryToRelease extract a Release from LibraryMetadata. LibraryMetadata must be validated before running this function.
type Version ¶
type Version struct {
// contains filtered or unexported fields
}
Version is the type for library versions.
func VersionFromString ¶
VersionFromString parses a string to a Version object.
func (*Version) MarshalJSON ¶
MarshalJSON returns the JSON encoding of the receiver.
func (*Version) UnmarshalJSON ¶
UnmarshalJSON parses the JSON-encoded argument and stores the result in the receiver.