library

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package library loads and hot-swaps Scenery c-shared library artifacts.

Generated scenerylib facades own typed operation APIs. This package owns the small untyped runtime below them: manifest validation, artifact digest and ABI checks, dlopen symbol binding, call accounting, and load-alongside swaps.

Index

Constants

View Source
const (
	ManifestKind           = "scenery.library.artifact"
	ManifestSchemaRevision = "sha256:35c46728a5d3ee20081c577ad1381f7b3821bb242a6bee0d61372c15af17dd66"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	GOOS       string `json:"goos"`
	GOARCH     string `json:"goarch"`
	Path       string `json:"path"`
	SHA256     string `json:"sha256"`
	GoVersion  string `json:"go_version"`
	GlibcFloor string `json:"glibc_floor,omitempty"`
}

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader owns all versions loaded for one declared library. Versions are intentionally retained for the life of the process: a Go c-shared runtime cannot be safely unloaded.

func NewLoader

func NewLoader(name, abiHash string, operationSymbols []string) (*Loader, error)

func (*Loader) Call

func (l *Loader) Call(symbol string, input []byte) ([]byte, error)

func (*Loader) Swap

func (l *Loader) Swap(manifestPath string) error

func (*Loader) Versions

func (l *Loader) Versions() []VersionInfo

type Manifest

type Manifest struct {
	Kind           string              `json:"kind"`
	SchemaRevision string              `json:"schema_revision"`
	Library        string              `json:"library"`
	Version        string              `json:"version"`
	ABIHash        string              `json:"abi_hash"`
	Artifacts      map[string]Artifact `json:"artifacts"`
}

type VersionInfo

type VersionInfo struct {
	Version  string `json:"version"`
	Path     string `json:"path"`
	SHA256   string `json:"sha256"`
	Active   int64  `json:"active"`
	Current  bool   `json:"current"`
	Draining bool   `json:"draining"`
}

Jump to

Keyboard shortcuts

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