components

package
v0.0.0-...-352826f Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindNewVersions

func FindNewVersions(id string, buildpackConfig cargo.Config, allVersions []string) ([]string, error)

FindNewVersions will take in a dependency ID, a buildpack.toml content in the form of a cargo.Config, and a slice of all upstream versions available. It will filter the upstream versions by buildpack.toml constraint and ID, and then return versions that conform to the constraint, number of patches, and are not already present in the buildpack.toml

func GeneratePurl

func GeneratePurl(name, version, sourceChecksum, source string) string

GeneratePurl generates a package URL given input information about a dependency

func Validate

func Validate(release RubyRelease) (bool, error)

func WriteOutput

func WriteOutput(outputPath string, dependencies []Dependency) error

Types

type Dependency

type Dependency struct {
	cargo.ConfigMetadataDependency
	Target string `json:"target,omitempty"`
}

func GenerateMetadata

func GenerateMetadata(release RubyRelease, targets []string, licenseRetriever License, deprecationDate DeprecationDate) ([]Dependency, error)

GenerateMetadata will generate Ruby dependency-specific metadata for each given target Note that `jammy` stack-related entries will only be generated when the version is 3.1 or greater, due to OpenSSL v3 incompatibilites with Ruby 3.0 and below.

type DeprecationDate

type DeprecationDate interface {
	GetDate(feed, version string) (string, error)
}

type DeprecationDateRetriever

type DeprecationDateRetriever struct{}

func NewDeprecationDateRetriever

func NewDeprecationDateRetriever() DeprecationDateRetriever

func (DeprecationDateRetriever) GetDate

func (DeprecationDateRetriever) GetDate(feed, version string) (string, error)

GetDeprecationDate will look up if a version has an EOL date, and return it if there is one, and return "" if there is not one.

type License

type License interface {
	LookupLicenses(dependencyName, sourceURL string) ([]interface{}, error)
}

type LicenseRetriever

type LicenseRetriever struct{}

func NewLicenseRetriever

func NewLicenseRetriever() LicenseRetriever

func (LicenseRetriever) LookupLicenses

func (LicenseRetriever) LookupLicenses(dependencyName, sourceURL string) ([]interface{}, error)

type ReleaseFetcher

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

func NewReleaseFetcher

func NewReleaseFetcher(feed string) ReleaseFetcher

func (ReleaseFetcher) GetUpstreamReleases

func (rf ReleaseFetcher) GetUpstreamReleases() (map[string]RubyRelease, error)

GetUpstreamVersions will take in a ReleaseFetcher version feed, parse the content, and return all available versions in the form of a map, where the key is the version (string) and the value is a struct containing obtained version metadata.

type RubyBranch

type RubyBranch struct {
	Name    string `yaml:"name"`
	EolDate string `yaml:"eol_date"`
}

type RubyRelease

type RubyRelease struct {
	Version string `yaml:"version"`
	URL     URL    `yaml:"url"`
	SHA256  SHA256 `yaml:"sha256"`
}

type SHA256

type SHA256 struct {
	Gz string `yaml:"gz"`
}

type URL

type URL struct {
	Gz string `yaml:"gz"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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