pkg

package
v0.1.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: Apache-2.0 Imports: 5 Imported by: 241

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllLanguages = []Language{
	Java,
	JavaScript,
	Python,
	Ruby,
	Go,
}

Functions

This section is empty.

Types

type ApkFileRecord

type ApkFileRecord struct {
	Path        string `json:"path"`
	OwnerUID    string `json:"owner-uid"`
	OwnerGUI    string `json:"owner-gid"`
	Permissions string `json:"permissions"`
	Checksum    string `json:"checksum"`
}

type ApkMetadata

type ApkMetadata struct {
	Package          string          `mapstructure:"P" json:"package"`
	OriginPackage    string          `mapstructure:"o" json:"origin-package"`
	Maintainer       string          `mapstructure:"m" json:"maintainer"`
	Version          string          `mapstructure:"V" json:"version"`
	License          string          `mapstructure:"L" json:"license"`
	Architecture     string          `mapstructure:"A" json:"architecture"`
	URL              string          `mapstructure:"U" json:"url"`
	Description      string          `mapstructure:"T" json:"description"`
	Size             int             `mapstructure:"S" json:"size"`
	InstalledSize    int             `mapstructure:"I" json:"installed-size"`
	PullDependencies string          `mapstructure:"D" json:"pull-dependencies"`
	PullChecksum     string          `mapstructure:"C" json:"pull-checksum"`
	GitCommitOfAport string          `mapstructure:"c" json:"git-commit-of-apk-port"`
	Files            []ApkFileRecord `json:"files"`
}

source: https://wiki.alpinelinux.org/wiki/Apk_spec

type Catalog

type Catalog struct {
	// contains filtered or unexported fields
}

func NewCatalog

func NewCatalog() *Catalog

func (*Catalog) Add

func (c *Catalog) Add(p Package)

func (*Catalog) Enumerate

func (c *Catalog) Enumerate(types ...Type) <-chan *Package

func (*Catalog) Package

func (c *Catalog) Package(id ID) *Package

func (*Catalog) PackageCount

func (c *Catalog) PackageCount() int

func (*Catalog) PackagesByFile

func (c *Catalog) PackagesByFile(ref file.Reference) []*Package

func (*Catalog) Sorted

func (c *Catalog) Sorted(types ...Type) []*Package

type DpkgMetadata

type DpkgMetadata struct {
	Package string `mapstructure:"Package" json:"package"`
	Source  string `mapstructure:"Source" json:"source"`
	Version string `mapstructure:"Version" json:"version"`
}

Available fields are described at http://manpages.ubuntu.com/manpages/xenial/man1/dpkg-query.1.html in the --showformat section

type ID

type ID int64

type JavaManifest

type JavaManifest struct {
	Name            string            `mapstructure:"Name" json:"name"`
	ManifestVersion string            `mapstructure:"Manifest-Version" json:"manifest-version"`
	SpecTitle       string            `mapstructure:"Specification-Title" json:"specification-title"`
	SpecVersion     string            `mapstructure:"Specification-Version" json:"specification-version"`
	SpecVendor      string            `mapstructure:"Specification-Vendor" json:"specification-vendor"`
	ImplTitle       string            `mapstructure:"Implementation-Title" json:"implementation-title"`
	ImplVersion     string            `mapstructure:"Implementation-Version" json:"implementation-version"`
	ImplVendor      string            `mapstructure:"Implementation-Vendor" json:"implementation-vendor"`
	Extra           map[string]string `mapstructure:",remain" json:"extra-fields"`
}

type JavaMetadata

type JavaMetadata struct {
	Manifest      *JavaManifest  `mapstructure:"Manifest" json:"manifest"`
	PomProperties *PomProperties `mapstructure:"PomProperties" json:"pom-properties"`
	Parent        *Package       `json:"parent-package"`
}

type Language

type Language uint
const (
	UnknownLanguage Language = iota
	Java
	JavaScript
	Python
	Ruby
	Go
)

func (Language) String

func (t Language) String() string

type Package

type Package struct {
	Name     string           `json:"manifest"`
	Version  string           `json:"version"`
	FoundBy  string           `json:"found-by"` // FoundBy is the cataloger that discovered this package
	Source   []file.Reference `json:"sources"`
	Licenses []string         `json:"licenses"` // TODO: should we move this into metadata?
	Language Language         `json:"language"` // TODO: should this support multiple languages as a slice?
	Type     Type             `json:"type"`
	Metadata interface{}      `json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

Package represents an application or library that has been bundled into a distributable format

func (Package) ID

func (p Package) ID() ID

func (Package) String

func (p Package) String() string

type PomProperties

type PomProperties struct {
	Path       string
	Name       string            `mapstructure:"name" json:"name"`
	GroupID    string            `mapstructure:"groupId" json:"group-id"`
	ArtifactID string            `mapstructure:"artifactId" json:"artifact-id"`
	Version    string            `mapstructure:"version" json:"version"`
	Extra      map[string]string `mapstructure:",remain" json:"extra-fields"`
}

type RpmMetadata

type RpmMetadata struct {
	Version   string `mapstructure:"Version" json:"version"`
	Epoch     int    `mapstructure:"Epoch" json:"epoch"`
	Arch      string `mapstructure:"Arch" json:"architecture"`
	Release   string `mapstructure:"Release" json:"release"`
	SourceRpm string `mapstructure:"SourceRpm" json:"source-rpm"`
	Size      int    `mapstructure:"Size" json:"size"`
	License   string `mapstructure:"License" json:"license"`
	Vendor    string `mapstructure:"Vendor" json:"vendor"`
}

type Type

type Type string
const (
	UnknownPkg Type = "UnknownPackage"
	ApkPkg     Type = "apk"
	BundlerPkg Type = "bundle"
	DebPkg     Type = "deb"
	EggPkg     Type = "egg"
	// PacmanPkg Type = "pacman"
	RpmPkg                Type = "rpm"
	WheelPkg              Type = "wheel"
	PoetryPkg             Type = "poetry"
	NpmPkg                Type = "npm"
	YarnPkg               Type = "yarn"
	PythonRequirementsPkg Type = "python-requirements"
	JavaPkg               Type = "java-archive"
	JenkinsPluginPkg      Type = "jenkins-plugin"
	GoModulePkg           Type = "go-module"
)

Jump to

Keyboard shortcuts

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