Documentation
¶
Overview ¶
Package sdk provides the core entry point and runtime configuration for building Tarmac WebAssembly functions.
The package exposes New to register a waPC handler and a RuntimeConfig that is shared by capability clients (e.g., HTTP). DefaultNamespace is used when a namespace is not explicitly provided.
Index ¶
Constants ¶
View Source
const DefaultNamespace = "tarmac"
DefaultNamespace is used when no explicit namespace is provided.
Variables ¶
View Source
var ( // ErrHandlerNil is returned when the provided function handler is nil. ErrHandlerNil = fmt.Errorf("function handler cannot be nil") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Namespace controls the function namespace to use for host callbacks. // If empty, DefaultNamespace is used. Namespace string // Handler is the function to be registered as the main WebAssembly entry point. Handler func([]byte) ([]byte, error) }
Config provides configuration options for SDK initialization.
type RuntimeConfig ¶
type RuntimeConfig struct { // Namespace is the function namespace used to scope host interactions. Namespace string }
RuntimeConfig carries configuration that is used during creation of SDK components.
type SDK ¶
type SDK struct {
// contains filtered or unexported fields
}
SDK represents the initialized runtime with a registered waPC handler.
func (*SDK) Config ¶
func (s *SDK) Config() RuntimeConfig
Config returns the current runtime configuration snapshot.
Directories
¶
Path | Synopsis |
---|---|
Package hostmock provides a friendly pretend host for waPC calls.
|
Package hostmock provides a friendly pretend host for waPC calls. |
Package http provides an HTTP client for Tarmac WebAssembly functions.
|
Package http provides an HTTP client for Tarmac WebAssembly functions. |
mock
Package mock provides a lightweight mock implementation of the http Client.
|
Package mock provides a lightweight mock implementation of the http Client. |
Click to show internal directories.
Click to hide internal directories.