libraries

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackupAndDeleteGitClone added in v1.1.3

func BackupAndDeleteGitClone(config *configuration.Config, repoMeta *Repo) error

BackupAndDeleteGitClone backs up and then deletes the library's Git clone folder.

func GenerateLibraryFromRepo

func GenerateLibraryFromRepo(repo *Repository) (*metadata.LibraryMetadata, error)

GenerateLibraryFromRepo parses a repository and returns the library metadata.

func RepoURLValid

func RepoURLValid(url string) bool

RepoURLValid returns whether the given URL has a valid format.

func RunAntiVirus

func RunAntiVirus(folder string) ([]byte, error)

RunAntiVirus scans the folder for viruses.

func RunArduinoLint

func RunArduinoLint(arduinoLintPath string, folder string, metadata *Repo) ([]byte, error)

RunArduinoLint runs Arduino Lint on the library and returns the report in the event of error or warnings.

func UpdateLibrary

func UpdateLibrary(release *db.Release, repoURL string, libraryDb *db.DB) error

UpdateLibrary adds a release to the library database.

Types

type GitURLsError

type GitURLsError struct {
	Repos []*Repo
}

GitURLsError is the type for the unknown or unsupported repositories data.

func (GitURLsError) Error

func (err GitURLsError) Error() string

type Repo

type Repo struct {
	URL         string
	Types       []string
	LibraryName string
}

Repo is the type for the library repository data.

func ListRepos

func ListRepos(reposFilename string) ([]*Repo, error)

ListRepos returns a filtered list of library registry entries loaded from the given data file.

func LoadRepoListFromFile

func LoadRepoListFromFile(filename string) ([]*Repo, error)

LoadRepoListFromFile returns an unfiltered list of library registry entries loaded from the given data file.

func (*Repo) AsFolder

func (repo *Repo) AsFolder() (string, error)

AsFolder returns the URL of the repo as path, without protocol prefix or suffix. For example if the repo URL is https://github.com/example/lib.git this function will return "github.com/example/lib"

type ReposByURL

type ReposByURL []*Repo

ReposByURL is the type for the libraries repository data.

func (ReposByURL) Len

func (r ReposByURL) Len() int

func (ReposByURL) Less

func (r ReposByURL) Less(i, j int) bool

func (ReposByURL) Swap

func (r ReposByURL) Swap(i, j int)

type Repository

type Repository struct {
	Repository *git.Repository
	FolderPath string
	URL        string
}

Repository represents a Git repository located on the filesystem.

func CloneOrFetch

func CloneOrFetch(repoMeta *Repo, folderName string) (*Repository, error)

CloneOrFetch returns a Repository object. If the repository is already present, it is opened. Otherwise, cloned.

Directories

Path Synopsis
Package archive handles the library release archive.
Package archive handles the library release archive.
Package metadata handles library.properties metadata.
Package metadata handles library.properties metadata.

Jump to

Keyboard shortcuts

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