Documentation ¶
Overview ¶
Copyright © 2022-2023 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.
Copyright © 2022 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.
Copyright © 2019-2023 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.
Copyright © 2023 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.
Copyright © 2022 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.
Copyright © 2022 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.
Copyright © 2022-2023 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.
Copyright © 2022 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.
Copyright © 2022-2023 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.
Index ¶
- Constants
- func SortArtifactList4ReposAndRequires(artsref *[]*artifact.PackageArtifact, rmap *map[string]*WagonRepository)
- func SortArtifactList4RequiresAndRepos(artsref *[]*artifact.PackageArtifact, rmap *map[string]*WagonRepository)
- func SortArtifactList4VersionAndRepos(artsref *[]*artifact.PackageArtifact, rmap *map[string]*WagonRepository, ...)
- type ArtifactIndex
- type ChannelRepoOpRes
- type ChannelSearchRes
- type Client
- type LuetFinalizer
- type Searcher
- type SearcherSimple
- func (s *SearcherSimple) Close()
- func (s *SearcherSimple) SearchArtifacts(opts *StonesSearchOpts) (*[]*art.PackageArtifact, error)
- func (s *SearcherSimple) SearchArtifactsOnRepo(name string, searchOpts *StonesSearchOpts) (*[]*art.PackageArtifact, error)
- func (s *SearcherSimple) SearchInstalled(opts *StonesSearchOpts) (*[]*Stone, error)
- func (s *SearcherSimple) SearchStones(opts *StonesSearchOpts) (*[]*Stone, error)
- func (s *SearcherSimple) SetMaskManager(m *mask.PackagesMaskManager)
- func (s *SearcherSimple) Setup()
- type Stone
- type StonesCatalog
- type StonesMap
- type StonesPack
- type StonesSearchOpts
- type StonesSearchTask
- type SyncOpts
- type WagonDocument
- func (f *WagonDocument) GetChecksums() artifact.Checksums
- func (f *WagonDocument) GetCompressionType() compression.Implementation
- func (f *WagonDocument) GetFileName() string
- func (f *WagonDocument) SetChecksums(c artifact.Checksums)
- func (f *WagonDocument) SetCompressionType(c compression.Implementation)
- func (f *WagonDocument) SetFileName(n string)
- type WagonIdentity
- func (w *WagonIdentity) BumpRevision()
- func (w *WagonIdentity) DownloadDocument(c Client, key string) (*artifact.PackageArtifact, error)
- func (w *WagonIdentity) GetAuthentication() map[string]string
- func (w *WagonIdentity) GetLastUpdate() string
- func (w *WagonIdentity) GetMetaPath() string
- func (w *WagonIdentity) GetName() string
- func (w *WagonIdentity) GetRevision() int
- func (w *WagonIdentity) GetTreePath() string
- func (w *WagonIdentity) GetType() string
- func (w *WagonIdentity) GetUrls() []string
- func (w *WagonIdentity) GetVerify() bool
- func (w *WagonIdentity) HasDocument(s string) bool
- func (w *WagonIdentity) IncrementRevision()
- func (w *WagonIdentity) Is2Update(newIdentity *WagonIdentity) bool
- func (w *WagonIdentity) Load(f string) error
- func (w *WagonIdentity) PurgeFiles()
- func (w *WagonIdentity) SetLastUpdate(u string)
- func (w *WagonIdentity) SetType(p string)
- func (w *WagonIdentity) SetVerify(p bool)
- func (w *WagonIdentity) Valid() bool
- func (w *WagonIdentity) Write(f string) error
- func (w *WagonIdentity) Yaml() ([]byte, error)
- type WagonProvides
- type WagonRepository
- func (w *WagonRepository) ClearCatalog()
- func (w *WagonRepository) Client() Client
- func (w *WagonRepository) ExplodeMetadata() error
- func (w *WagonRepository) GetLastUpdate() string
- func (w *WagonRepository) GetMetaPath(repobasedir string) string
- func (w *WagonRepository) GetRevision() int
- func (w *WagonRepository) GetTreePath(repobasedir string) string
- func (w *WagonRepository) HasLocalWagonIdentity(wdir string) bool
- func (w *WagonRepository) IncrementRevision()
- func (w *WagonRepository) ReadWagonIdentify(wdir string) error
- func (w *WagonRepository) SearchArtifacts(opts *StonesSearchOpts, m *mask.PackagesMaskManager) (*[]*artifact.PackageArtifact, error)
- func (w *WagonRepository) SearchArtifactsFromCatalog(opts *StonesSearchOpts) (*[]*artifact.PackageArtifact, error)
- func (w *WagonRepository) SearchStones(opts *StonesSearchOpts, m *mask.PackagesMaskManager) (*[]*Stone, error)
- func (w *WagonRepository) SearchStonesFromCatalog(opts *StonesSearchOpts) (*[]*Stone, error)
- func (w *WagonRepository) SetLastUpdate(u string)
- func (w *WagonRepository) Sync(force bool) error
- type WagonStones
- func (s *WagonStones) LoadCatalog(identity *WagonIdentity) (*StonesCatalog, error)
- func (s *WagonStones) Search(opts *StonesSearchOpts, repoName, repoDir string, m *mask.PackagesMaskManager) (*[]*Stone, error)
- func (s *WagonStones) SearchArtifacts(opts *StonesSearchOpts, repoName, repoDir string, ...) (*[]*artifact.PackageArtifact, error)
- func (s *WagonStones) SearchArtifactsFromCatalog(opts *StonesSearchOpts, repoName string) (*[]*artifact.PackageArtifact, error)
- func (s *WagonStones) SearchFromCatalog(opts *StonesSearchOpts, repoName string) (*[]*Stone, error)
- type WagonsRails
Constants ¶
const ( REPOSITORY_METAFILE = "repository.meta.yaml" REPOSITORY_SPECFILE = "repository.yaml" TREE_TARBALL = "tree.tar" COMPILERTREE_TARBALL = "compilertree.tar" REPOFILE_TREE_KEY = "tree" REPOFILE_TREEV2_KEY = "treev2" REPOFILE_COMPILER_TREE_KEY = "compilertree" REPOFILE_META_KEY = "meta" // TODO: To move on a specific package DiskRepositoryType = "disk" HttpRepositoryType = "http" DockerRepositoryType = "docker" )
Variables ¶
This section is empty.
Functions ¶
func SortArtifactList4ReposAndRequires ¶
func SortArtifactList4ReposAndRequires(artsref *[]*artifact.PackageArtifact, rmap *map[string]*WagonRepository)
Sort packages ordered for repository priority, for number of requires and for PackageName()
func SortArtifactList4RequiresAndRepos ¶
func SortArtifactList4RequiresAndRepos(artsref *[]*artifact.PackageArtifact, rmap *map[string]*WagonRepository)
func SortArtifactList4VersionAndRepos ¶
func SortArtifactList4VersionAndRepos(artsref *[]*artifact.PackageArtifact, rmap *map[string]*WagonRepository, reverse bool)
Types ¶
type ArtifactIndex ¶
type ArtifactIndex []*artifact.PackageArtifact
type ChannelRepoOpRes ¶
type ChannelRepoOpRes struct { Error error Repo *config.LuetRepository }
type ChannelSearchRes ¶
type ChannelSearchRes struct { Stones *[]*Stone Artifacts *[]*artifact.PackageArtifact Error error }
type LuetFinalizer ¶
type LuetFinalizer struct { Shell []string `json:"shell,omitempty" yaml:"shell,omitempty"` Install []string `json:"install,omitempty" yaml:"install,omitempty"` Uninstall []string `json:"uninstall,omitempty" yaml:"uninstall,omitempty"` }
func NewLuetFinalizerFromYaml ¶
func NewLuetFinalizerFromYaml(data []byte) (*LuetFinalizer, error)
func (*LuetFinalizer) RunInstall ¶
func (f *LuetFinalizer) RunInstall(targetRootfs string) error
func (*LuetFinalizer) RunUninstall ¶
func (f *LuetFinalizer) RunUninstall(targetRootfs string) error
type Searcher ¶
type Searcher interface { SearchArtifacts(searchOpts *StonesSearchOpts) (*[]*art.PackageArtifact, error) SearchStones(searchOpts *StonesSearchOpts) (*[]*Stone, error) SearchInstalled(searchOpts *StonesSearchOpts) (*[]*Stone, error) SearchArtifactsOnRepo(name string, searchOpts *StonesSearchOpts) (*[]*art.PackageArtifact, error) SetMaskManager(m *mask.PackagesMaskManager) }
type SearcherSimple ¶
type SearcherSimple struct { Config *config.LuetConfig MaskManager *mask.PackagesMaskManager Database pkg.PackageDatabase }
func NewSearcherSimple ¶
func NewSearcherSimple(cfg *config.LuetConfig) *SearcherSimple
func (*SearcherSimple) Close ¶
func (s *SearcherSimple) Close()
func (*SearcherSimple) SearchArtifacts ¶
func (s *SearcherSimple) SearchArtifacts(opts *StonesSearchOpts) (*[]*art.PackageArtifact, error)
func (*SearcherSimple) SearchArtifactsOnRepo ¶
func (s *SearcherSimple) SearchArtifactsOnRepo(name string, searchOpts *StonesSearchOpts) (*[]*art.PackageArtifact, error)
func (*SearcherSimple) SearchInstalled ¶
func (s *SearcherSimple) SearchInstalled(opts *StonesSearchOpts) (*[]*Stone, error)
func (*SearcherSimple) SearchStones ¶
func (s *SearcherSimple) SearchStones(opts *StonesSearchOpts) (*[]*Stone, error)
func (*SearcherSimple) SetMaskManager ¶
func (s *SearcherSimple) SetMaskManager(m *mask.PackagesMaskManager)
func (*SearcherSimple) Setup ¶
func (s *SearcherSimple) Setup()
type Stone ¶
type Stone struct { Name string `json:"name" yaml:"name"` Category string `json:"category" yaml:"category"` Version string `json:"version" yaml:"version"` License string `json:"license,omitempty" yaml:"license,omitempty"` Repository string `json:"repository,omitempty" yaml:"repository"` Hidden bool `json:"hidden,omitempty" yaml:"hidden,omitempty"` Files []string `json:"files,omitempty" yaml:"files,omitempty"` Annotations map[string]interface{} `json:"annotations,omitempty" yaml:"annotations,omitempty"` Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` UseFlags []string `json:"use_flags,omitempty" yaml:"use_flags,omitempty"` Provides []*Stone `json:"provides,omitempty" yaml:"provides,omitempty"` Requires []*Stone `json:"requires,omitempty" yaml:"requires,omitempty"` Conflicts []*Stone `json:"conflicts,omitempty" yaml:"conflicts,omitempty"` }
func NewStone ¶
func NewStone(p *artifact.PackageArtifact, repo string, withFiles, full bool) *Stone
func (*Stone) GetVersion ¶
func (*Stone) HumanReadableString ¶
func (*Stone) ToPackage ¶
func (s *Stone) ToPackage() *pkg.DefaultPackage
type StonesCatalog ¶
type StonesCatalog struct {
Index ArtifactIndex `json:"index" yaml:"index"`
}
type StonesPack ¶
type StonesPack struct {
Stones []*Stone `json:"stones" yaml:"stones"`
}
func (*StonesPack) ToMap ¶
func (sp *StonesPack) ToMap() *StonesMap
type StonesSearchOpts ¶
type StonesSearchOpts struct { Packages pkg.DefaultPackages Categories []string Names []string Labels []string LabelsMatches []string Matches []string FilesOwner []string Annotations []string Hidden bool AndCondition bool WithFiles bool WithRootfsPrefix bool Full bool OnlyPackages bool IgnoreMasks bool }
func (*StonesSearchOpts) CloneWithPkgs ¶
func (so *StonesSearchOpts) CloneWithPkgs(pkgs pkg.DefaultPackages) *StonesSearchOpts
type StonesSearchTask ¶
type WagonDocument ¶
type WagonDocument struct { FileName string `json:"filename" yaml:"filename"` CompressionType compression.Implementation `json:"compressiontype,omitempty" yaml:"compressiontype,omitempty"` Checksums artifact.Checksums `json:"checksums,omitempty" yaml:"checksums,omitempty"` }
func NewWagonDocument ¶
func NewWagonDocument(f string) *WagonDocument
func (*WagonDocument) GetChecksums ¶
func (f *WagonDocument) GetChecksums() artifact.Checksums
GetChecksums gets the checksum of the repository file. Each repository can ship arbitrary file that will be downloaded by the client in case of need, this gets the checksums that the client will use to verify the artifact
func (*WagonDocument) GetCompressionType ¶
func (f *WagonDocument) GetCompressionType() compression.Implementation
GetCompressionType gets the compression type of the repository file. Each repository can ship arbitrary file that will be downloaded by the client in case of need, this gets the compression type that the client will use to uncompress the artifact
func (*WagonDocument) GetFileName ¶
func (f *WagonDocument) GetFileName() string
GetFileName returns the name of the repository file. Each repository can ship arbitrary file that will be downloaded by the client in case of need, this gets the filename that the client will pull
func (*WagonDocument) SetChecksums ¶
func (f *WagonDocument) SetChecksums(c artifact.Checksums)
SetChecksums sets the checksum of the repository file. Each repository can ship arbitrary file that will be downloaded by the client in case of need, this sets the checksums that the client will use to verify the artifact
func (*WagonDocument) SetCompressionType ¶
func (f *WagonDocument) SetCompressionType(c compression.Implementation)
SetCompressionType sets the compression type of the repository file. Each repository can ship arbitrary file that will be downloaded by the client in case of need, this sets the compression type that the client will use to uncompress the artifact
func (*WagonDocument) SetFileName ¶
func (f *WagonDocument) SetFileName(n string)
SetFileName sets the name of the repository file. Each repository can ship arbitrary file that will be downloaded by the client in case of need, this set the filename that the client will pull
type WagonIdentity ¶
type WagonIdentity struct { *config.LuetRepository `yaml:",inline" json:",inline"` IdentityFile string `yaml:"-" json:"-"` RepositoryFiles map[string]*WagonDocument `yaml:"repo_files,omitempty" json:"repo_files,omitempty"` }
func NewWagonIdentify ¶
func NewWagonIdentify(l *config.LuetRepository) *WagonIdentity
func (*WagonIdentity) BumpRevision ¶
func (w *WagonIdentity) BumpRevision()
func (*WagonIdentity) DownloadDocument ¶
func (w *WagonIdentity) DownloadDocument(c Client, key string) (*artifact.PackageArtifact, error)
func (*WagonIdentity) GetAuthentication ¶
func (w *WagonIdentity) GetAuthentication() map[string]string
func (*WagonIdentity) GetLastUpdate ¶
func (w *WagonIdentity) GetLastUpdate() string
func (*WagonIdentity) GetMetaPath ¶
func (w *WagonIdentity) GetMetaPath() string
func (*WagonIdentity) GetName ¶
func (w *WagonIdentity) GetName() string
func (*WagonIdentity) GetRevision ¶
func (w *WagonIdentity) GetRevision() int
func (*WagonIdentity) GetTreePath ¶
func (w *WagonIdentity) GetTreePath() string
func (*WagonIdentity) GetType ¶
func (w *WagonIdentity) GetType() string
func (*WagonIdentity) GetUrls ¶
func (w *WagonIdentity) GetUrls() []string
func (*WagonIdentity) GetVerify ¶
func (w *WagonIdentity) GetVerify() bool
func (*WagonIdentity) HasDocument ¶
func (w *WagonIdentity) HasDocument(s string) bool
func (*WagonIdentity) IncrementRevision ¶
func (w *WagonIdentity) IncrementRevision()
func (*WagonIdentity) Is2Update ¶
func (w *WagonIdentity) Is2Update(newIdentity *WagonIdentity) bool
func (*WagonIdentity) Load ¶
func (w *WagonIdentity) Load(f string) error
func (*WagonIdentity) PurgeFiles ¶
func (w *WagonIdentity) PurgeFiles()
func (*WagonIdentity) SetLastUpdate ¶
func (w *WagonIdentity) SetLastUpdate(u string)
func (*WagonIdentity) SetType ¶
func (w *WagonIdentity) SetType(p string)
func (*WagonIdentity) SetVerify ¶
func (w *WagonIdentity) SetVerify(p bool)
func (*WagonIdentity) Valid ¶
func (w *WagonIdentity) Valid() bool
func (*WagonIdentity) Write ¶
func (w *WagonIdentity) Write(f string) error
func (*WagonIdentity) Yaml ¶
func (w *WagonIdentity) Yaml() ([]byte, error)
type WagonProvides ¶
type WagonProvides struct {
Provides map[string][]*pkg.DefaultPackage `yaml:"provides,omitempty" json:"provides,omitempty"`
}
func NewWagonProvides ¶
func NewWagonProvides() *WagonProvides
func (*WagonProvides) Add ¶
func (wp *WagonProvides) Add(provname string, p *pkg.DefaultPackage)
func (*WagonProvides) Load ¶
func (wp *WagonProvides) Load(f string) error
func (*WagonProvides) WriteProvidesYAML ¶
func (wp *WagonProvides) WriteProvidesYAML(dst string) error
type WagonRepository ¶
type WagonRepository struct { Identity *WagonIdentity Stones *WagonStones }
func NewWagonRepository ¶
func NewWagonRepository(l *config.LuetRepository) *WagonRepository
func (*WagonRepository) ClearCatalog ¶
func (w *WagonRepository) ClearCatalog()
func (*WagonRepository) Client ¶
func (w *WagonRepository) Client() Client
func (*WagonRepository) ExplodeMetadata ¶
func (w *WagonRepository) ExplodeMetadata() error
func (*WagonRepository) GetLastUpdate ¶
func (w *WagonRepository) GetLastUpdate() string
func (*WagonRepository) GetMetaPath ¶
func (w *WagonRepository) GetMetaPath(repobasedir string) string
func (*WagonRepository) GetRevision ¶
func (w *WagonRepository) GetRevision() int
func (*WagonRepository) GetTreePath ¶
func (w *WagonRepository) GetTreePath(repobasedir string) string
func (*WagonRepository) HasLocalWagonIdentity ¶
func (w *WagonRepository) HasLocalWagonIdentity(wdir string) bool
func (*WagonRepository) IncrementRevision ¶
func (w *WagonRepository) IncrementRevision()
func (*WagonRepository) ReadWagonIdentify ¶
func (w *WagonRepository) ReadWagonIdentify(wdir string) error
func (*WagonRepository) SearchArtifacts ¶
func (w *WagonRepository) SearchArtifacts(opts *StonesSearchOpts, m *mask.PackagesMaskManager) (*[]*artifact.PackageArtifact, error)
func (*WagonRepository) SearchArtifactsFromCatalog ¶
func (w *WagonRepository) SearchArtifactsFromCatalog(opts *StonesSearchOpts) (*[]*artifact.PackageArtifact, error)
func (*WagonRepository) SearchStones ¶
func (w *WagonRepository) SearchStones(opts *StonesSearchOpts, m *mask.PackagesMaskManager) (*[]*Stone, error)
func (*WagonRepository) SearchStonesFromCatalog ¶
func (w *WagonRepository) SearchStonesFromCatalog(opts *StonesSearchOpts) (*[]*Stone, error)
func (*WagonRepository) SetLastUpdate ¶
func (w *WagonRepository) SetLastUpdate(u string)
func (*WagonRepository) Sync ¶
func (w *WagonRepository) Sync(force bool) error
The Sync method update the repository.
In particular, follow these steps:
- download the main repository.yaml file to a temporary directory
- load the new repository.yaml as WagonIdentity and compare revision and last update date with the current status.
- if there is a new revision download the meta and tree file and unpack them to the local cache.
NOTE:
Until I will implement the new metadata tarball i need process metadata and write under the treefs the artifacts information. I will create a provides.yaml with all repositories provides to speedup research.
If force is true the download of the meta and tree files are done always.
type WagonStones ¶
type WagonStones struct {
Catalog *StonesCatalog
}
func NewWagonStones ¶
func NewWagonStones() *WagonStones
func (*WagonStones) LoadCatalog ¶
func (s *WagonStones) LoadCatalog(identity *WagonIdentity) (*StonesCatalog, error)
func (*WagonStones) Search ¶
func (s *WagonStones) Search( opts *StonesSearchOpts, repoName, repoDir string, m *mask.PackagesMaskManager, ) (*[]*Stone, error)
func (*WagonStones) SearchArtifacts ¶
func (s *WagonStones) SearchArtifacts( opts *StonesSearchOpts, repoName, repoDir string, maskManager *mask.PackagesMaskManager) (*[]*artifact.PackageArtifact, error)
The SearchArtifacts instead to read artifacts from memory (catalog) it tries to return all artifacts matching with the search options reading metadata from files under the treefs directory.
func (*WagonStones) SearchArtifactsFromCatalog ¶
func (s *WagonStones) SearchArtifactsFromCatalog( opts *StonesSearchOpts, repoName string) (*[]*artifact.PackageArtifact, error)
func (*WagonStones) SearchFromCatalog ¶
func (s *WagonStones) SearchFromCatalog(opts *StonesSearchOpts, repoName string) (*[]*Stone, error)
type WagonsRails ¶
type WagonsRails struct {
Config *cfg.LuetConfig
}
func NewWagonsRails ¶
func NewWagonsRails(c *cfg.LuetConfig) *WagonsRails