descriptor

package
v0.0.0-...-5c4efe0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadDescriptor = errors.New("no parseable module descriptor")
View Source
var ErrBadExt = errors.New("bad file extension")
View Source
var ErrDuplicateRequires = errors.New("the required module path has already been declared")
View Source
var ErrNoDescriptor = errors.New("no readable module descriptor")
View Source
var ErrUnknownOutputFormat = errors.New("unknown output format")

Functions

This section is empty.

Types

type Descriptor

type Descriptor struct {
	*modfile.File
}

func New

func New(path string) (*Descriptor, error)

Parses a Go .mod module descriptor, without using the “go mod” command

func (*Descriptor) AnyRequires

func (descriptor *Descriptor) AnyRequires(build bool, quiet bool) (results Requires, err error)

Returns the provides associated with a module descriptor

func (*Descriptor) BuildRequires

func (descriptor *Descriptor) BuildRequires(quiet bool) (results Requires, err error)

func (*Descriptor) Path

func (descriptor *Descriptor) Path() string

func (*Descriptor) Provides

func (descriptor *Descriptor) Provides(path string, ver *version.Version,
	quiet bool) (results Provides, err error)

Returns the provides associated with a module descriptor To be future-proof, can return multiple results, even though the initial implementation only returns one item

func (*Descriptor) Requires

func (descriptor *Descriptor) Requires(quiet bool) (results Requires, err error)

func (*Descriptor) Trim

func (descriptor *Descriptor) Trim(quiet bool) error

Remove module directives that make no sense in a clean system component environment

type Provides

type Provides map[string]*version.Version

func (Provides) Format

func (provides Provides) Format(format string, onlyName bool, onlyVersion bool,
	namespace string) (string, error)

func (Provides) Go

func (provides Provides) Go(onlyName bool, onlyVersion bool) (results string)

func (Provides) RPM

func (provides Provides) RPM(onlyName bool, onlyVersion bool, namespace string,
) (results string)

type Requires

type Requires map[string]*VersionRange

func (Requires) Format

func (requires Requires) Format(format string, namespace string,
) (string, error)

func (Requires) Go

func (requires Requires) Go() (results string)

func (Requires) RPM

func (requires Requires) RPM(namespace string) (results string)

type VersionRange

type VersionRange struct {
	Floor    *version.Version   `json:",omitempty"`
	Excludes []*version.Version `json:",omitempty"`
}

func (*VersionRange) Clean

func (vr *VersionRange) Clean()

Jump to

Keyboard shortcuts

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