runtimepayload

package
v1.0.62-beta.8 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package runtimepayload implements the self-contained runtime payload format.

Index

Constants

View Source
const (
	PayloadVersion = "20260909"
)

Variables

View Source
var (
	ErrBundleUnavailable = errors.New("embedded runtime payload unavailable")
)

Functions

func BuildContainer

func BuildContainer(payloadRoot string, capacity int) ([]byte, error)

BuildContainer creates a deterministic, fixed-capacity payload container.

func Embedded

func Embedded() []byte

Embedded returns the target-specific payload compiled into dws.

func InjectFile

func InjectFile(executablePath, payloadRoot string) error

InjectFile replaces the compiled payload slot without changing binary size. It is used before the final platform code signature is applied.

func LibraryName

func LibraryName(goos, goarch string) (string, error)

LibraryName returns the library shipped for a target.

func Materialize

func Materialize(container []byte, userCacheDir, targetOS, targetArch string) (string, error)

Materialize verifies and extracts a container into a private, content-addressed cache, then returns the runtime library path.

func MaterializeAdjacent

func MaterializeAdjacent(container []byte, root, targetOS, targetArch string) (string, error)

MaterializeAdjacent publishes only DWS-owned resources next to a resolved executable. A conflict or busy publisher is an error: the caller uses cache. No caller may load a library until this method has verified the whole bundle.

func MaterializeFile

func MaterializeFile(executablePath, userCacheDir, targetOS, targetArch string) (string, error)

MaterializeFile locates and extracts a payload from a foreign target binary. Release validation uses this without executing the artifact.

func WriteContainer

func WriteContainer(path, payloadRoot string, capacity int) error

WriteContainer writes a generated payload container to path.

Types

type Descriptor

type Descriptor struct {
	Offset        int
	Size          int
	ContainerSize int
	SHA256        [sha256.Size]byte
}

Descriptor identifies a fixed-capacity payload container inside a binary.

func Find

func Find(binaryData []byte) (Descriptor, error)

Find locates the valid payload container compiled into a binary. Marker constants elsewhere in the executable are ignored because their headers and archive checksums cannot validate as a complete container.

func Inspect

func Inspect(container []byte) (Descriptor, error)

Inspect validates a standalone container and returns its descriptor.

Jump to

Keyboard shortcuts

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