Documentation
¶
Index ¶
- Constants
- type ArtifactInfo
- func (artifact *ArtifactInfo) DirectoryPath(distributedFiles string) string
- func (artifact *ArtifactInfo) Download(verbose bool, dest string)
- func (artifact *ArtifactInfo) FilePath(distributedFiles string) string
- func (artifact *ArtifactInfo) FullName() string
- func (artifact *ArtifactInfo) Install(verbose bool, distributedFiles string)
- func (artifact *ArtifactInfo) IsInstalled(distributedFiles string) bool
- func (artifact *ArtifactInfo) SetInfoFromFileName(filename string) error
- func (artifact *ArtifactInfo) Uninstall(verbose bool, distributedFiles string)
- type Index
Constants ¶
const ( // UpstreamTypeLocal repository upstream type UpstreamTypeLocal = "local" // UpstreamTypeDirectory repository upstream type UpstreamTypeDirectory = "directory" // UpstreamTypeGitHub repository upstream type UpstreamTypeGitHub = "github-release" // UpstreamTypeErcoleRepo repository upstream type UpstreamTypeErcoleRepo = "ercole-reposervice" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArtifactInfo ¶
type ArtifactInfo struct { Repository string Installed bool `json:"-"` Version string ReleaseDate string Filename string Name string OperatingSystemFamily string OperatingSystem string Arch string UpstreamType string UpstreamInfo map[string]interface{} }
ArtifactInfo contains info about all files in repository
func (*ArtifactInfo) DirectoryPath ¶
func (artifact *ArtifactInfo) DirectoryPath(distributedFiles string) string
DirectoryPath get the path of the directory containing the artifact file
func (*ArtifactInfo) Download ¶
func (artifact *ArtifactInfo) Download(verbose bool, dest string)
Download the artifact
func (*ArtifactInfo) FilePath ¶
func (artifact *ArtifactInfo) FilePath(distributedFiles string) string
FilePath get the path of the artifact file
func (*ArtifactInfo) FullName ¶
func (artifact *ArtifactInfo) FullName() string
FullName return the fullname of the file
func (*ArtifactInfo) Install ¶
func (artifact *ArtifactInfo) Install(verbose bool, distributedFiles string)
Install the artifact
func (*ArtifactInfo) IsInstalled ¶
func (artifact *ArtifactInfo) IsInstalled(distributedFiles string) bool
IsInstalled return true if file is detected in the distribution directory
func (*ArtifactInfo) SetInfoFromFileName ¶
func (artifact *ArtifactInfo) SetInfoFromFileName(filename string) error
SetInfoFromFileName sets to fileInfo informations taken from filename
func (*ArtifactInfo) Uninstall ¶
func (artifact *ArtifactInfo) Uninstall(verbose bool, distributedFiles string)
Uninstall the artifact
type Index ¶
type Index []*ArtifactInfo
Index is the index of all artifact in a repository
func ReadIndexFromFile ¶
ReadIndexFromFile read index from the filesystem
func (Index) SaveOnFile ¶
SaveOnFile save index on the filesystem
func (*Index) SearchArtifactByArg ¶
func (idx *Index) SearchArtifactByArg(arg string) *ArtifactInfo
SearchArtifactByArg get *ArtifactInfo by string
func (*Index) SearchLatestArtifactByRepositoryAndName ¶
func (idx *Index) SearchLatestArtifactByRepositoryAndName(repo string, name string) *ArtifactInfo
SearchLatestArtifactByRepositoryAndName get latest version of a *ArtifactInfo by repo and name
func (Index) SortArtifactInfo ¶
func (idx Index) SortArtifactInfo()
SortArtifactInfo sort artifact information inside index