cargo

package
v0.74.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ValidFiles specifies accepted Cargo files.
	ValidFiles [1]string = [1]string{"Cargo.toml"}
)

Functions

This section is empty.

Types

type Cargo

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

Cargo struct holds all information needed to generate cargo manifest.

func New

func New(spec interface{}, rootDir, scmID string) (Cargo, error)

New return a new valid Cargo object.

func (Cargo) DiscoverManifests

func (c Cargo) DiscoverManifests() ([][]byte, error)

type MatchingRule

type MatchingRule struct {
	// Path specifies a Cargo crate path pattern, the pattern requires to match all of name, not just a subpart of the path.
	Path string `yaml:",omitempty"`
	// Crates specifies the list of Cargo crates to check
	Crates map[string]string `yaml:",omitempty"`
	// Registries specifies the list of Cargo registries to check
	Registries []string `yaml:",omitempty"`
}

MatchingRule allows to specifies rules to identify manifest

type MatchingRules

type MatchingRules []MatchingRule

type Spec

type Spec struct {
	// RootDir defines the root directory used to recursively search for Cargo.toml
	RootDir string `yaml:",omitempty"`
	// Ignore specifies rule to ignore Cargo.toml update.
	Ignore MatchingRules `yaml:",omitempty"`
	// Only specify required rule to restrict Cargo.toml update.
	Only MatchingRules `yaml:",omitempty"`
	// Auths provides a map of registry credentials where the key is the registry URL without scheme
	Registries map[string]cargo.Registry `yaml:",omitempty"`
	/*
		`versionfilter` provides parameters to specify the version pattern to use when generating manifest.

		kind - semver
			versionfilter of kind `semver` uses semantic versioning as version filtering
			pattern accepts one of:
				`patch` - patch only update patch version
				`minor` - minor only update minor version
				`major` - major only update major versions
				`a version constraint` such as `>= 1.0.0`

		kind - regex
			versionfilter of kind `regex` uses regular expression as version filtering
			pattern accepts a valid regular expression

		example:
		“`
			versionfilter:
				kind: semver
				pattern: minor
		“`

		and its type like regex, semver, or just latest.
	*/
	VersionFilter version.Filter `yaml:",omitempty"`
}

Spec defines the Cargo parameters.

Jump to

Keyboard shortcuts

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