filepayload

package
v0.2.0-rc.17-linux-arm64 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// FilePayloadDigestSHA256 identifies the digest algorithm used for file payload metadata.
	FilePayloadDigestSHA256 = "sha256"

	// FilePayloadDefaultMIMEType is used when a connector cannot determine a safer media type.
	FilePayloadDefaultMIMEType = "application/octet-stream"
)

Variables

This section is empty.

Functions

func NormalizeFilePayloadFilename

func NormalizeFilePayloadFilename(filename string) string

NormalizeFilePayloadFilename reduces untrusted filename hints to a basename.

func NormalizeFilePayloadMIMEType

func NormalizeFilePayloadMIMEType(mimeType string) string

NormalizeFilePayloadMIMEType strips parameters and falls back to octet-stream when empty.

Types

type FilePayloadMetadata

type FilePayloadMetadata struct {
	Filename        string `json:"filename,omitempty"         yaml:"filename,omitempty"`
	MIMEType        string `json:"mime_type"                  yaml:"mime_type"`
	SizeBytes       int64  `json:"size_bytes"                 yaml:"size_bytes"`
	DigestAlgorithm string `json:"digest_algorithm,omitempty" yaml:"digest_algorithm,omitempty"`
	Digest          string `json:"digest,omitempty"           yaml:"digest,omitempty"`
}

FilePayloadMetadata describes an opaque file payload without exposing its raw bytes.

func CloneFilePayloadMetadata

func CloneFilePayloadMetadata(metadata *FilePayloadMetadata) *FilePayloadMetadata

CloneFilePayloadMetadata returns an independent metadata pointer for mutable containers.

func NewFilePayloadMetadata

func NewFilePayloadMetadata(filename, mimeType string, content []byte) FilePayloadMetadata

NewFilePayloadMetadata computes stable metadata for an in-memory file payload.

type Reference

type Reference struct {
	ID        string `json:"id"`
	SizeBytes int64  `json:"size_bytes"`
	SHA256    string `json:"sha256"`
}

Reference identifies encrypted retained input inside the execution protocol. Public result and run metadata must omit this capability-bearing reference.

func CloneReference

func CloneReference(ref *Reference) *Reference

CloneReference keeps process-local payload clones independent.

Jump to

Keyboard shortcuts

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