cargopackage

package
v0.76.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDummyIndex

func CreateDummyIndex() (string, error)

func GetMockClient added in v0.44.0

func GetMockClient(baseUrl string, mockedToken string, mockedBody string, mockedHTTPStatusCode int, mockedHeaderFormat string) *httpclient.MockClient

Types

type CargoPackage

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

CargoPackage defines a resource of type "cargopackage"

func New

func New(spec interface{}, isSCM bool) (*CargoPackage, error)

New returns a reference to a newly initialized CargoPackage object from a cargopackage.Spec or an error if the provided Spec triggers a validation error.

func (*CargoPackage) Changelog

func (cp *CargoPackage) Changelog() string

Changelog returns the changelog for this resource, or an empty string if not supported

func (*CargoPackage) Condition

func (cp *CargoPackage) Condition(source string, scm scm.ScmHandler) (pass bool, message string, err error)

Condition checks if a cargo package with a specific version is published We assume that if we can't find the package version in the index, then it means it doesn't exist.

func (CargoPackage) Source

func (cp CargoPackage) Source(workingDir string, resultSource *result.Source) error

Source returns the latest npm package version

func (*CargoPackage) Target

func (cp *CargoPackage) Target(source string, scm scm.ScmHandler, dryRun bool, resultTarget *result.Target) error

type PackageCrate

type PackageCrate struct {
	Name string `json:"name"`
}

type PackageData

type PackageData struct {
	Crate    PackageCrate     `json:"crate"`
	Versions []PackageVersion `json:"versions"`
}

type PackageVersion

type PackageVersion struct {
	Num     string `json:"num,omitempty"`
	Version string `json:"vers,omitempty"`
	Yanked  bool   `json:"yanked"`
}

type Spec

type Spec struct {
	// !deprecated, please use Registry.URL
	IndexUrl string `yaml:",omitempty" jsonschema:"-"`
	// [S][C] Registry specifies the registry to use
	Registry cargo.Registry `yaml:",omitempty"`
	// [S][C] Package specifies the name of the package
	Package string `yaml:",omitempty" jsonschema:"required"`
	// [C] Defines a specific package version
	Version string `yaml:",omitempty"`
	// [S] VersionFilter provides parameters to specify version pattern and its type like regex, semver, or just latest.
	VersionFilter version.Filter `yaml:",omitempty"`
}

Spec defines a specification for a "cargopackage" resource parsed from an updatecli manifest file

Jump to

Keyboard shortcuts

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