librariesindex

package
v0.0.0-...-0031c6d Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index struct {
	Libraries map[string]*Library
}

Index represents the list of libraries available for download

func LoadIndex

func LoadIndex(indexFile *paths.Path) (*Index, error)

LoadIndex reads a library_index.json and create the corresponding Index

func (*Index) FindIndexedLibrary

func (idx *Index) FindIndexedLibrary(lib *libraries.Library) *Library

FindIndexedLibrary search an indexed library that matches the provided installed library or nil if not found

func (*Index) FindLibraryUpdate

func (idx *Index) FindLibraryUpdate(lib *libraries.Library) *Release

FindLibraryUpdate check if an installed library may be updated using one of the indexed libraries. This function returns the Release to install to update the library if found, otherwise nil is returned.

func (*Index) FindRelease

func (idx *Index) FindRelease(ref *Reference) *Release

FindRelease search a library Release in the index. Returns nil if the release is not found

type Library

type Library struct {
	Name     string
	Releases map[string]*Release
	Latest   *Release `json:"-"`
	Index    *Index   `json:"-"`
}

Library is a library available for download

func (*Library) Versions

func (library *Library) Versions() []*semver.Version

Versions returns an array of all versions available of the library

type Reference

type Reference struct {
	Name    string          // The name of the parsed item.
	Version *semver.Version // The Version of the parsed item.
}

Reference uniquely identify a Library in the library index

func ParseArgs

func ParseArgs(args []string) ([]*Reference, error)

ParseArgs parses a sequence of "item@version" tokens and returns a Name-Version slice.

If version is not present it is assumed as "latest" version.

func (*Reference) String

func (r *Reference) String() string

type Release

type Release struct {
	Author        string
	Version       *semver.Version
	Maintainer    string
	Sentence      string
	Paragraph     string
	Website       string
	Category      string
	Architectures []string
	Types         []string
	Resource      *resources.DownloadResource

	Library *Library `json:"-"`
}

Release is a release of a library available for download

func (*Release) String

func (r *Release) String() string

Jump to

Keyboard shortcuts

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