manifest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package manifest reads block.toml: the human-written statement of which tools a project wants and roughly which versions.

platforms = ["linux/amd64", "darwin/arm64"]   # optional; default: this machine

[tools]
foundry = "1.7"

[tools.foo]
version = "1.2"
[tools.foo.source]
type = "github_release"
repo = "example/foo"
asset = "foo_{version}_{os}_{arch}.tar.gz"
bin = ["foo"]

Index

Constants

View Source
const FileName = "block.toml"

FileName is the manifest file name block looks for.

Variables

This section is empty.

Functions

func Find

func Find(dir string) (string, error)

Find walks from dir upward looking for block.toml and returns the directory that holds it.

Types

type Manifest

type Manifest struct {
	// Platforms are the platforms `block lock` resolves artifacts for. Empty
	// means the current platform only.
	Platforms []platform.Platform
	// Tools are sorted by name.
	Tools []Tool
}

Manifest is a parsed block.toml.

func Load

func Load(path string) (*Manifest, error)

Load reads and parses the manifest at path.

func Parse

func Parse(data []byte) (*Manifest, error)

Parse parses manifest bytes.

func (*Manifest) EffectivePlatforms

func (m *Manifest) EffectivePlatforms(current platform.Platform) []platform.Platform

EffectivePlatforms returns the declared platforms, or [current] when none are declared.

func (*Manifest) Names

func (m *Manifest) Names() []string

Names lists the tool names in order.

func (*Manifest) Tool

func (m *Manifest) Tool(name string) (Tool, bool)

Tool returns the entry with the given name.

type Tool

type Tool struct {
	Name       string
	Constraint version.Constraint
	// Source is set for project-local definitions and nil for registry tools.
	Source *recipe.Source
}

Tool is one [tools] entry.

Jump to

Keyboard shortcuts

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