requirements

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Requirement

type Requirement struct {
	// Original line from the file
	Raw string

	// Type of requirement
	Type RequirementType

	// For registry assets
	Name            string
	VersionSpec     string
	VersionOperator string // ==, >=, >, <=, <, ~=

	// For git sources
	GitURL          string
	GitRef          string
	GitName         string
	GitSubdirectory string

	// For path sources
	Path string

	// For HTTP sources
	URL string
}

Requirement represents a single requirement from the requirements file

func Parse

func Parse(filePath string) ([]Requirement, error)

Parse parses a requirements file

func ParseLine

func ParseLine(line string) (Requirement, error)

ParseLine parses a single requirement line

func (Requirement) String

func (r Requirement) String() string

String returns a string representation of the requirement

type RequirementType

type RequirementType string

RequirementType indicates the type of requirement

const (
	RequirementTypeRegistry RequirementType = "registry"
	RequirementTypeGit      RequirementType = "git"
	RequirementTypePath     RequirementType = "path"
	RequirementTypeHTTP     RequirementType = "http"
)

Jump to

Keyboard shortcuts

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