runtimepayload

package
v1.0.62-beta.3 Latest Latest
Warning

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

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

Documentation

Overview

Package runtimepayload implements the self-contained runtime payload format.

Index

Constants

View Source
const (
	PayloadVersion = "20260825"
)

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 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