manifest

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRequreViersionFiled     = errors.New("require version field")
	ErrEnvFieldMustStringSlice = errors.New("env field must string slice")
	ErrUnknownToolType         = errors.New("unknown tool type")
	ErrDuplicateBinaryName     = errors.New("duplicate binary name")
)
View Source
var ErrDuplicatePath = errors.New("duplicate path")

Functions

func ComapreName

func ComapreName[T, U Namer](self T, other U) int

func EncodeManifest

func EncodeManifest(writer io.Writer, manifest *Manifest) error

func EncodeManifestLock

func EncodeManifestLock(writer io.Writer, manifest *ManifestLock) error

func SortNamers

func SortNamers[S ~[]E, E Namer](namers S) error

func ToPackage

func ToPackage(path string, version *semver.Version) string

Types

type Constraints

type Constraints struct {
	semver.Constraints
	// contains filtered or unexported fields
}

func NewConstraints

func NewConstraints(text string) (*Constraints, error)

func NewReferenceConstraintsWithVersion

func NewReferenceConstraintsWithVersion(text string) (*Constraints, error)

func (*Constraints) IsReference

func (constraints *Constraints) IsReference() bool

func (*Constraints) MarshalText

func (constraints *Constraints) MarshalText() ([]byte, error)

func (*Constraints) UnmarshalText

func (constraints *Constraints) UnmarshalText(text []byte) error

type Manifest

type Manifest struct {
	Tools []ManifestTool
}

func DecodeManifest

func DecodeManifest(reader io.Reader) (*Manifest, error)

type ManifestLock

type ManifestLock struct {
	Tools []ManifestLockTool `toml:"tools,omitempty"`
}

func DecodeManifestLock

func DecodeManifestLock(reader io.Reader) (*ManifestLock, error)

type ManifestLockTool

type ManifestLockTool struct {
	ToolPath
	Version semver.Version `toml:"version"`
	Tool
}

type ManifestTool

type ManifestTool struct {
	ToolPath
	Version Constraints
	Tool
}

func ParseArgument

func ParseArgument(command *gocommand.Memorized, text string) (ManifestTool, error)

type Namer

type Namer interface {
	Name() string
}

type Tool

type Tool struct {
	Env []string `toml:"env,omitempty"`
}

type ToolPath

type ToolPath struct {
	Path string `toml:"path"`
}

func NewToolPath

func NewToolPath(path string) ToolPath

func (ToolPath) BinaryName

func (p ToolPath) BinaryName() string

func (ToolPath) Name

func (p ToolPath) Name() string

Jump to

Keyboard shortcuts

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