vagrant

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package vagrant validates Vagrant boxes and indexes their deployment properties.

Index

Constants

View Source
const (
	MaxArchiveBytes int64 = 16 << 30

	PropName     = "box_name"
	PropProvider = "box_provider"
	PropVersion  = "box_version"
)

Variables

This section is empty.

Functions

func Serves

func Serves(t repo.PackageType) bool

func ValidComponent

func ValidComponent(s string) bool

func ValidName

func ValidName(s string) bool

func Verified

func Verified(p types.Properties, sha string) (Identity, Box, bool)

Types

type Box

type Box struct {
	Provider     string `json:"provider"`
	Architecture string `json:"architecture,omitempty"`
}

func ReadBox

func ReadBox(ctx context.Context, r io.Reader, size int64) (Box, error)

ReadBox validates every archive member and checksum without extracting any paths or executing the embedded Vagrantfile. ZIP files are spooled to a private temporary file so a VM image never needs to fit in memory.

type Handler

type Handler struct{ generic.Handler }

func (Handler) Admit

func (Handler) Admit(
	ctx context.Context,
	env format.Env,
	c repo.Config,
	w format.Write,
) (format.Write, error)

func (Handler) AdmitAnnotation

func (Handler) AdmitAnnotation(
	_ context.Context,
	_ format.Env,
	_ repo.Config,
	_ types.Item,
	a format.Annotation,
) error

func (Handler) Annotated

func (Handler) Annotated(
	ctx context.Context,
	env format.Env,
	c repo.Config,
	it types.Item,
	a format.Annotation,
) error

func (Handler) Deleted

func (Handler) Deleted(ctx context.Context, env format.Env, c repo.Config, _ []types.Item) error

func (Handler) Deleting

func (Handler) Deployed

func (h Handler) Deployed(ctx context.Context, env format.Env, c repo.Config, it types.Item) error

func (Handler) Inspect

func (Handler) Inspect(
	ctx context.Context,
	env format.Env,
	_ repo.Config,
	w format.Write,
) (any, error)

func (Handler) Reindex

func (Handler) Reindex(ctx context.Context, env format.Env, c repo.Config) error

type Identity

type Identity struct{ Name, Provider, Version string }

func Properties

func Properties(p types.Properties) (Identity, bool)

Jump to

Keyboard shortcuts

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