compute

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package compute registers content-addressed Web Worker and WebAssembly assets for GoFastr applications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifest

func Manifest() map[string]Versions

Manifest returns a snapshot of registered names and content hashes.

func RegisterWASM

func RegisterWASM(name string, wasm []byte)

RegisterWASM registers a WebAssembly module under name. Re-registering identical bytes is a no-op; conflicting bytes panic.

func RegisterWorker

func RegisterWorker(name string, js []byte)

RegisterWorker registers a self-contained Web Worker script under name. Re-registering identical bytes is a no-op; conflicting bytes panic.

Types

type Asset

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

Asset is an immutable registered compute asset.

func LookupWASM

func LookupWASM(name string) (*Asset, bool)

LookupWASM returns the registered WebAssembly asset for name.

func LookupWorker

func LookupWorker(name string) (*Asset, bool)

LookupWorker returns the registered worker asset for name.

func (*Asset) Hash

func (a *Asset) Hash() string

Hash returns the asset's SHA-256 content hash as lowercase hexadecimal.

func (*Asset) WriteTo

func (a *Asset) WriteTo(w io.Writer) (int64, error)

WriteTo writes the registered bytes without copying them.

type Versions

type Versions struct {
	JS   string `json:"js,omitempty"`
	WASM string `json:"wasm,omitempty"`
}

Versions contains the registered hashes for one compute asset name.

Jump to

Keyboard shortcuts

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