manifest

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Filename = "nem.ver"

Variables

View Source
var ErrManifestNotFound = errors.New("manifest file not found in current or any parent directory")

Functions

func Find

func Find(startDir string) (string, error)

func InvalidEnvKeyError added in v0.7.0

func InvalidEnvKeyError(key string) error

InvalidEnvKeyError is the error for a key rejected by ValidEnvKey.

func Mutate

func Mutate(path string, fn func(File) (File, error)) error

func PkgEntriesEqual

func PkgEntriesEqual(a, b PkgEntries) bool

func RemoveEnv

func RemoveEnv(path string, keys []string) error

func RemovePackage

func RemovePackage(path, pkgName string) error

func Replace

func Replace(path string, file File) error

func Resolve

func Resolve(scope Scope) (string, error)

Resolve returns the path for scope. The file may not exist yet; callers that need it to exist must use ResolveExisting.

func ResolveExisting

func ResolveExisting(scope Scope) (string, error)

func UpsertManyEnv

func UpsertManyEnv(path string, updates EnvEntries) error

func UpsertManyPackages

func UpsertManyPackages(path string, updates PkgEntries) error

func ValidEnvKey

func ValidEnvKey(s string) bool

func Write

func Write(path string, file File) error

Types

type EnvEntries

type EnvEntries []EnvEntry

func (EnvEntries) ByKey

func (e EnvEntries) ByKey() map[string]string

type EnvEntry

type EnvEntry struct {
	Key   string
	Value string
}

type File

type File struct {
	Packages PkgEntries
	Env      EnvEntries
}

func Read

func Read(path string) (File, error)

type PkgEntries

type PkgEntries []PkgEntry

func MergePackages

func MergePackages(entries ...PkgEntries) PkgEntries

func (PkgEntries) ByName

func (e PkgEntries) ByName() map[string]PkgEntry

func (PkgEntries) Direct

func (e PkgEntries) Direct() PkgEntries

func (PkgEntries) Indirect

func (e PkgEntries) Indirect() PkgEntries

func (PkgEntries) Refs

func (e PkgEntries) Refs() pkg.Refs

type PkgEntry

type PkgEntry struct {
	pkg.Ref
	Direct bool
}

type Scope

type Scope int
const (
	ScopeProject Scope = iota
	ScopeGlobal
)

func ScopeOf

func ScopeOf(global bool) Scope

Jump to

Keyboard shortcuts

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