Help us shape the future of Go! Take the 2026 Go Developer Survey

bundle

package
v0.19.1254 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CurrentSchemaVersion     = 3
	LogicalManifestMediaType = "application/vnd.nuon.appbundle.manifest.v1+json"
	ProvenanceMediaType      = "application/vnd.nuon.appbundle.provenance.v1+json"
	QualificationMediaType   = "application/vnd.nuon.appbundle.qualification.v1+json"
	PlanEnvelopeMediaType    = "application/vnd.nuon.appbundle.plan.v1+json"
	SourceArchiveMediaType   = "application/vnd.nuon.appbundle.source-archive.v1+json"
	BundleArtifactType       = "application/vnd.nuon.appbundle.bundle.v1"
	RunnerBinaryArtifactType = "application/vnd.nuon.appbundle.runner-binary.v1"
	RunnerBinaryMediaType    = "application/octet-stream"
)
View Source
const (
	DefaultMaxArchiveEntries   = 1_000_000
	DefaultMaxArchiveFileBytes = int64(10 << 30)
	DefaultMaxArchiveBytes     = int64(20 << 30)
	DefaultMaxDecoderMemory    = uint64(1 << 30)
	DefaultMaxDecoderWindow    = uint64(1 << 30)
	DefaultMaxMetadataBytes    = int64(16 << 20)
)

Variables

This section is empty.

Functions

func Extract

func Extract(dst string, r io.Reader) (string, error)

func ExtractWithOptions

func ExtractWithOptions(dst string, r io.Reader, opts ExtractOptions) (_ string, retErr error)

func IsManifestMediaType

func IsManifestMediaType(mediaType string) bool

func Successors

func Successors(mediaType string, b []byte) ([]ocispec.Descriptor, error)

func TotalSize

func TotalSize(ctx context.Context, src oras.ReadOnlyTarget, desc ocispec.Descriptor) (int64, error)

func VerifyBlobs

func VerifyBlobs(dir string) error

Types

type Action

type Action struct {
	Name         string            `json:"name"`
	ConfigDigest string            `json:"config_digest"`
	Definition   *ActionDefinition `json:"definition,omitempty"`
	Steps        []Step            `json:"steps,omitempty"`
}

type ActionDefinition

type ActionDefinition struct {
	Image                 string                    `json:"image,omitempty"`
	TimeoutNanos          int64                     `json:"timeout_nanos,omitempty"`
	Role                  string                    `json:"role,omitempty"`
	BreakGlassRoleARN     string                    `json:"break_glass_role_arn,omitempty"`
	EnableKubeConfig      bool                      `json:"enable_kube_config,omitempty"`
	KubernetesContextName string                    `json:"kubernetes_context_name,omitempty"`
	ComponentDependencies []string                  `json:"component_dependencies,omitempty"`
	References            []string                  `json:"references,omitempty"`
	Triggers              []ActionTriggerDefinition `json:"triggers,omitempty"`
	Steps                 []ActionStepDefinition    `json:"steps,omitempty"`
}

type ActionStepDefinition

type ActionStepDefinition struct {
	Name                 string            `json:"name"`
	Index                int               `json:"index,omitempty"`
	Command              string            `json:"command,omitempty"`
	InlineContentsDigest string            `json:"inline_contents_digest,omitempty"`
	Environment          map[string]string `json:"environment,omitempty"`
}

type ActionTriggerDefinition

type ActionTriggerDefinition struct {
	Type          string `json:"type"`
	Index         int    `json:"index,omitempty"`
	CronSchedule  string `json:"cron_schedule,omitempty"`
	ComponentName string `json:"component_name,omitempty"`
}

type Artifact

type Artifact struct {
	MediaType            string `json:"media_type"`
	Digest               string `json:"digest"`
	Size                 int64  `json:"size"`
	PlatformOS           string `json:"platform_os,omitempty"`
	PlatformArchitecture string `json:"platform_architecture,omitempty"`
}

type Bundle

type Bundle struct {
	Manifest         LogicalManifest
	BundleDescriptor ocispec.Descriptor
	Roots            []ocispec.Descriptor
	Provenance       json.RawMessage
	Qualification    json.RawMessage
	PlanEnvelope     json.RawMessage
	// contains filtered or unexported fields
}

func Open

func Open(ctx context.Context, dir string) (*Bundle, error)

func (*Bundle) ExtractRunnerBinary

func (b *Bundle) ExtractRunnerBinary(ctx context.Context, w io.Writer) error

ExtractRunnerBinary streams the packaged runner binary to w. The manifest artifact is the packed OCI manifest; the binary itself is its single octet-stream layer.

func (*Bundle) Members

func (b *Bundle) Members() []Member

func (*Bundle) Store

func (b *Bundle) Store() oras.ReadOnlyTarget

type Component

type Component struct {
	Name         string              `json:"name"`
	Type         string              `json:"type"`
	ConfigDigest string              `json:"config_digest"`
	Definition   ComponentDefinition `json:"definition,omitempty"`
	Source       Source              `json:"source"`
	Artifact     Artifact            `json:"artifact"`
}

type ComponentDefinition

type ComponentDefinition map[string]any

type Documents

type Documents struct {
	Provenance          json.RawMessage
	QualificationReport json.RawMessage
	PlanEnvelope        json.RawMessage
	SourceArchive       json.RawMessage
}

type ExtractOptions

type ExtractOptions struct {
	MaxEntries       int
	MaxFileBytes     int64
	MaxTotalBytes    int64
	MaxDecoderMemory uint64
	MaxDecoderWindow uint64
}

type GenerateOptions

type GenerateOptions struct {
	MaxContentBytes int64
	MaxBlobBytes    int64
	OnBlobVerified  func(ocispec.Descriptor)
}

type Image

type Image struct {
	Name       string   `json:"name"`
	Repository string   `json:"repository"`
	Artifact   Artifact `json:"artifact"`
}

type LogicalManifest

type LogicalManifest struct {
	SchemaVersion int             `json:"schema_version"`
	Release       ReleaseIdentity `json:"release"`
	Package       PackageIdentity `json:"package"`
	Target        Target          `json:"target"`
	Components    []Component     `json:"components,omitempty"`
	Sandbox       *Sandbox        `json:"sandbox,omitempty"`
	Images        []Image         `json:"images,omitempty"`
	Actions       []Action        `json:"actions,omitempty"`
	Runbooks      []Runbook       `json:"runbooks,omitempty"`
	StackAssets   []StackAsset    `json:"stack_assets,omitempty"`
	Runner        *Runner         `json:"runner,omitempty"`
}

type Member

type Member struct {
	Key       string        `json:"key"`
	Kind      string        `json:"kind"`
	Name      string        `json:"name"`
	MediaType string        `json:"media_type"`
	Digest    digest.Digest `json:"digest"`
	Size      int64         `json:"size"`
}

type PackageIdentity

type PackageIdentity struct {
	ID     string `json:"id"`
	Digest string `json:"digest"`
	Format string `json:"format"`
	Target string `json:"target"`
}

type ReleaseIdentity

type ReleaseIdentity struct {
	ID     string `json:"id"`
	Digest string `json:"digest"`
}

type Result

type Result struct {
	ManifestDescriptor ocispec.Descriptor
	BundleDescriptor   ocispec.Descriptor
	TransportSHA256    string
	Index              json.RawMessage
}

func Generate

func Generate(ctx context.Context, dst io.Writer, logical LogicalManifest, roots []Root) (Result, error)

func GenerateWithDocuments

func GenerateWithDocuments(ctx context.Context, dst io.Writer, logical LogicalManifest, documents Documents, roots []Root) (Result, error)

func GenerateWithOptions

func GenerateWithOptions(ctx context.Context, dst io.Writer, logical LogicalManifest, documents Documents, roots []Root, opts GenerateOptions) (Result, error)

type Root

type Root struct {
	Descriptor ocispec.Descriptor
	Source     oras.ReadOnlyTarget
}

type Runbook

type Runbook struct {
	Name         string            `json:"name"`
	ConfigDigest string            `json:"config_digest"`
	Definition   RunbookDefinition `json:"definition"`
}

type RunbookDefinition

type RunbookDefinition struct {
	ReadmeDigest string                     `json:"readme_digest,omitempty"`
	Triggers     []RunbookTriggerDefinition `json:"triggers,omitempty"`
	Inputs       []RunbookInputDefinition   `json:"inputs,omitempty"`
	Steps        []RunbookStepDefinition    `json:"steps"`
}

type RunbookInputDefinition

type RunbookInputDefinition struct {
	Name        string `json:"name"`
	DisplayName string `json:"display_name,omitempty"`
	Description string `json:"description,omitempty"`
	Default     string `json:"default,omitempty"`
	Type        string `json:"type,omitempty"`
	Index       int    `json:"index,omitempty"`
	Required    bool   `json:"required,omitempty"`
	Sensitive   bool   `json:"sensitive,omitempty"`
}

type RunbookStepDefinition

type RunbookStepDefinition struct {
	Kind                 string            `json:"kind"`
	Name                 string            `json:"name,omitempty"`
	Index                int               `json:"index,omitempty"`
	Reference            string            `json:"reference,omitempty"`
	Component            string            `json:"component,omitempty"`
	Role                 string            `json:"role,omitempty"`
	PlanOnly             bool              `json:"plan_only,omitempty"`
	DeployDependents     bool              `json:"deploy_dependents,omitempty"`
	TearDownDependents   bool              `json:"tear_down_dependents,omitempty"`
	SkipComponentDeploys bool              `json:"skip_component_deploys,omitempty"`
	Command              string            `json:"command,omitempty"`
	InlineContentsDigest string            `json:"inline_contents_digest,omitempty"`
	Environment          map[string]string `json:"environment,omitempty"`
	TimeoutNanos         int64             `json:"timeout_nanos,omitempty"`
	TriggerName          string            `json:"trigger_name,omitempty"`
	EventTypes           []string          `json:"event_types,omitempty"`
	FiltersDigest        string            `json:"filters_digest,omitempty"`
}

type RunbookTriggerDefinition added in v0.19.1243

type RunbookTriggerDefinition struct {
	Type         string `json:"type"`
	CronSchedule string `json:"cron_schedule,omitempty"`
}

type Runner

type Runner struct {
	Version   string    `json:"version,omitempty"`
	SourceURL string    `json:"source_url,omitempty"`
	Binary    *Artifact `json:"binary,omitempty"`
	Image     *Image    `json:"image,omitempty"`
}

Runner packages the runner itself so an offline install never phones home: a standalone binary matching the bundle target, and optionally the runner container image for hosts that run it under a container runtime.

type Sandbox

type Sandbox struct {
	Type         string   `json:"type"`
	ConfigDigest string   `json:"config_digest"`
	Source       Source   `json:"source"`
	Artifact     Artifact `json:"artifact"`
}

type Source

type Source struct {
	Repository   string `json:"repository,omitempty"`
	RequestedRef string `json:"requested_ref,omitempty"`
	Commit       string `json:"commit,omitempty"`
	Directory    string `json:"directory,omitempty"`
	Version      string `json:"version,omitempty"`
	Digest       string `json:"digest,omitempty"`
}

type StackAsset

type StackAsset struct {
	Role      string `json:"role"`
	SourceURL string `json:"source_url"`
	Digest    string `json:"digest"`
	MediaType string `json:"media_type"`
	Size      int64  `json:"size"`
}

type Step

type Step struct {
	Name                 string    `json:"name"`
	Command              string    `json:"command,omitempty"`
	InlineContentsDigest string    `json:"inline_contents_digest"`
	Source               *Source   `json:"source,omitempty"`
	Artifact             *Artifact `json:"artifact,omitempty"`
}

type Target

type Target struct {
	OS           string `json:"os"`
	Architecture string `json:"architecture"`
}

Jump to

Keyboard shortcuts

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