cargopackage

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDummyIndex

func CreateDummyIndex() (string, error)

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) (bool, error)

Condition checks that a git tag exists

func (*CargoPackage) ConditionFromSCM

func (cp *CargoPackage) ConditionFromSCM(source string, scm scm.ScmHandler) (bool, error)

ConditionFromSCM test if a tag exists from a git repository specific from SCM

func (CargoPackage) Source

func (cp CargoPackage) Source(workingDir string) (string, error)

Source returns the latest npm package version

func (*CargoPackage) Target

func (cp *CargoPackage) Target(source string, dryRun bool) (bool, error)

func (*CargoPackage) TargetFromSCM

func (cp *CargoPackage) TargetFromSCM(source string, scm scm.ScmHandler, dryRun bool) (bool, []string, string, error)

type CargoUser

type CargoUser struct {
	Avatar string `json:"avatar"`
	Id     int    `json:"id"`
	Login  string `json:"login"`
	Name   string `json:"name"`
	Url    string `json:"url"`
}

type PackageCategory

type PackageCategory struct {
	Category    string `json:"category"`
	CratesCnt   int    `json:"crates_cnt"`
	CreatedAt   string `json:"created_at"`
	Description string `json:"description"`
	Id          string `json:"id"`
	Slug        string `json:"slug"`
}

type PackageCrate

type PackageCrate struct {
	Categories    []string `json:"categories"`
	CreatedAt     string   `json:"created_at"`
	Description   string   `json:"description"`
	Documentation string   `json:"documentation"`
	Downloads     int      `json:"downloads"`
	ExactMatch    bool     `json:"exact_match"`
	Homepage      string   `json:"homepage"`
	Id            string   `json:"id"`
	Keywords      []string `json:"keywords"`
	Links         struct {
		OwnerTeam           string `json:"owner_team"`
		OwnerUser           string `json:"owner_user"`
		Owners              string `json:"owners"`
		ReverseDependencies string `json:"reverse_dependencies"`
		VersionDownloads    string `json:"version_downloads"`
		Versions            string `json:"versions"`
	} `json:"links"`
	MaxStableVersion string `json:"max_stable_version"`
	MaxVersion       string `json:"max_version"`
	Name             string `json:"name"`
	NewestVersion    string `json:"newest_version"`
	RecentDownloads  int    `json:"recent_downloads"`
	Repository       string `json:"repository"`
	UpdatedAt        string `json:"updated_at"`
	Versions         []int  `json:"versions"`
}

type PackageData

type PackageData struct {
	Categories []PackageCategory `json:"categories"`
	Keywords   []PackageKeyword  `json:"keywords"`
	Crate      PackageCrate      `json:"crate"`
	Versions   []PackageVersion  `json:"versions"`
}

type PackageKeyword

type PackageKeyword struct {
	CratesCnt int    `json:"crates_cnt"`
	CreatedAt string `json:"created_at"`
	Keyword   string `json:"keyword"`
	Id        string `json:"id"`
}

type PackageVersion

type PackageVersion struct {
	AuditActions []struct {
		Action string    `json:"action"`
		Time   string    `json:"time"`
		User   CargoUser `json:"user"`
	} `json:"audit_actions"`
	Checksum  string              `json:"checksum"`
	Crate     string              `json:"crate"`
	CrateSize int                 `json:"crate_size"`
	CreatedAt string              `json:"created_at"`
	DlPath    string              `json:"dl_path"`
	Downloads int                 `json:"downloads"`
	Features  map[string][]string `json:"features"`
	Id        int                 `json:"id"`
	License   string              `json:"license"`
	Links     struct {
		Authors         string `json:"authors"`
		Dependencies    string `json:"dependencies"`
		VersionDownload string `json:"version_downloads"`
	} `json:"links"`
	Num         string    `json:"num,omitempty"`
	PublishedBy CargoUser `json:"published_by"`
	ReadmePath  string    `json:"readme_path"`
	UpdatedAt   string    `json:"updated_at"`
	Version     string    `json:"vers,omitempty"`
	Yanked      bool      `json:"yanked"`
}

type Spec

type Spec struct {
	// [S][C] IndexUrl specifies the url of the index to use to check version
	// If set, package version will be checked against the API
	IndexUrl string `yaml:",omitempty"`
	// [S][C] IndexDir specifies the directory of the index to use to check version
	// If set, package version will be checked using the file structure
	IndexDir string `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 "dockerimage" 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