cargo

package
v1.22.3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

View Source
const PropertyYanked = "cargo.yanked"

Variables

View Source
var (
	ErrInvalidName    = errors.New("package name is invalid")
	ErrInvalidVersion = errors.New("package version is invalid")
)

Functions

This section is empty.

Types

type Dependency

type Dependency struct {
	Name            string   `json:"name"`
	Req             string   `json:"req"`
	Features        []string `json:"features"`
	Optional        bool     `json:"optional"`
	DefaultFeatures bool     `json:"default_features"`
	Target          *string  `json:"target"`
	Kind            string   `json:"kind"`
	Registry        *string  `json:"registry"`
	Package         *string  `json:"package"`
}

type Metadata

type Metadata struct {
	Dependencies     []*Dependency       `json:"dependencies,omitempty"`
	Features         map[string][]string `json:"features,omitempty"`
	Authors          []string            `json:"authors,omitempty"`
	Description      string              `json:"description,omitempty"`
	DocumentationURL string              `json:"documentation_url,omitempty"`
	ProjectURL       string              `json:"project_url,omitempty"`
	Readme           string              `json:"readme,omitempty"`
	Keywords         []string            `json:"keywords,omitempty"`
	Categories       []string            `json:"categories,omitempty"`
	License          string              `json:"license,omitempty"`
	RepositoryURL    string              `json:"repository_url,omitempty"`
	Links            string              `json:"links,omitempty"`
}

Metadata represents the metadata of a Cargo package

type Package

type Package struct {
	Name        string
	Version     string
	Metadata    *Metadata
	Content     io.Reader
	ContentSize int64
}

Package represents a Cargo package

func ParsePackage

func ParsePackage(r io.Reader) (*Package, error)

ParsePackage reads the metadata and content of a package

Jump to

Keyboard shortcuts

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