pkg

package
v0.0.0-...-2208570 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package pkg contains the in memory representations of a Package in the pm system and associated utilities.

Index

Constants

View Source
const InvalidPackageChars = "/="

InvalidPackageChars contains a list of characters that are disallowed in package names

Variables

View Source
var ErrInvalidPackageName = errors.New("pkg: invalid package name")

ErrInvalidPackageName occurs when a package name contains one of InvalidPackageChars or is any of the exact InvalidNames.

View Source
var ErrInvalidPackageVersion = errors.New("pkg: invalid package version")

ErrInvalidPackageVersion occurs when a package version contains one of InvalidPackageChars or is any of the exact InvalidNames.

View Source
var InvalidNames = []string{".", ".."}

InvalidNames are package names & versions that are invalid

Functions

This section is empty.

Types

type ByNameVersion

type ByNameVersion []Package

ByNameVersion is an implementation of sort.Interface around a slice of Package

func (ByNameVersion) Len

func (b ByNameVersion) Len() int

func (ByNameVersion) Less

func (b ByNameVersion) Less(i, j int) bool

func (ByNameVersion) Swap

func (b ByNameVersion) Swap(i, j int)

type Package

type Package struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

Package is a representation of basic package metadata

func (*Package) Validate

func (pkg *Package) Validate() error

Validate returns an error if the package contains an invalid value in one of it's fields.

Jump to

Keyboard shortcuts

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