function

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package function is a client package for WASM functions running within a Tarmac server.

This package provides a user-friendly interface for interacting with other WASM functions. Users can use this package to call other loaded WASM functions. This capability enables users to create and call functions as if they are internal only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Namespace controls the function namespace to use for host callbacks. The default value is "default" which is the global namespace.
	// Users can provide an alternative namespace by specifying this field.
	Namespace string

	// HostCall is used internally for host callbacks. This is mainly here for testing.
	HostCall func(string, string, string, []byte) ([]byte, error)
}

Config provides users with the ability to specify namespaces, function handlers and other key information required to execute the function.

type Function

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

Function provides a simple interface for Tarmac Functions to send messages via the standard function.

func New

func New(cfg Config) (*Function, error)

New creates a new Function with the provided configuration.

func (*Function) Call

func (f *Function) Call(name string, input []byte) ([]byte, error)

Call will call other functions registered via Tarmac routes.

Jump to

Keyboard shortcuts

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