bundle

package
v0.2202.3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Overview

Package bundle implements support for unified runtime bundles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExplodedPath

func ExplodedPath(dataDir string) string

ExplodedPath returns the path under the data directory that contains all of the exploded bundles.

Types

type Bundle

type Bundle struct {
	Manifest *Manifest
	Data     map[string][]byte
}

Bundle is a runtime bundle instance.

func Open

func Open(fn string) (*Bundle, error)

Open opens and validates a runtime bundle instance.

func (*Bundle) Add

func (bnd *Bundle) Add(fn string, b []byte) error

Add adds/overwrites a file to/in the bundle.

func (*Bundle) Close

func (bnd *Bundle) Close() error

Close closes the bundle, releasing resources.

func (*Bundle) ExplodedPath

func (bnd *Bundle) ExplodedPath(dataDir, fn string) string

ExplodedPath returns the path that the corresponding asset will be written to via WriteExploded.

func (*Bundle) MrEnclave

func (bnd *Bundle) MrEnclave() (*sgx.MrEnclave, error)

MrEnclave returns the MRENCLAVE of the SGX excutable.

func (*Bundle) ResetManifest added in v0.2201.9

func (bnd *Bundle) ResetManifest()

ResetManifest removes the serialized manifest from the bundle so that it can be regenerated on the next call to Write.

This needs to be used after doing modifications to bundles.

func (*Bundle) Validate

func (bnd *Bundle) Validate() error

Validate validates the runtime bundle for well-formedness.

func (*Bundle) Write

func (bnd *Bundle) Write(fn string) error

Write serializes a runtime bundle to the on-disk representation.

func (*Bundle) WriteExploded

func (bnd *Bundle) WriteExploded(dataDir string) error

WriteExploded writes the extracted runtime bundle to the appropriate location under the specified data directory.

type Manifest

type Manifest struct {
	// Name is the optional human readable runtime name.
	Name string `json:"name,omitempty"`

	// ID is the runtime ID.
	ID common.Namespace `json:"id"`

	// Version is the runtime version.
	Version version.Version `json:"version,omitempty"`

	// Executable is the name of the runtime ELF executable file.
	Executable string `json:"executable"`

	// SGX is the SGX specific manifest metadata if any.
	SGX *SGXMetadata `json:"sgx,omitempty"`

	// Digests is the cryptographic digests of the bundle contents,
	// excluding the manifest.
	Digests map[string]hash.Hash `json:"digests"`
}

Manifest is a deserialized runtime bundle manifest.

type SGXMetadata

type SGXMetadata struct {
	// Executable is the name of the SGX enclave executable file.
	Executable string `json:"executable"`

	// Signature is the name of the SGX enclave signature file.
	Signature string `json:"signature"`
}

SGXMetadata is the SGX specific manifest metadata.

Jump to

Keyboard shortcuts

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