storebind

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 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

Overview

Package storebind binds the WIT world app.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App is an instance of a component of the WIT world app.

func Instantiate

func Instantiate(ctx context.Context, r wazy.Runtime, wasm []byte, imports Imports, opts ...component.Option) (*App, error)

Instantiate instantiates a component of the world app, with imports implementing its imports. opts are passed on to component.Instantiate, for what the bindings leave to the host, such as WASI.

func (*App) Close

func (x *App) Close(ctx context.Context) error

Close closes the instance.

func (*App) Instance

func (x *App) Instance() *component.Instance

Instance is the underlying component instance.

func (*App) Run

func (x *App) Run(ctx context.Context) (string, error)

Run calls the export run.

type Bucket

type Bucket uint32

Bucket is the host's representation of the WIT resource example:store/kv@1.0.0.bucket: the value the host returns from its constructor, and receives back as self.

type Error

type Error struct {
	Case ErrorCase
	// contains filtered or unexported fields
}

Error is the WIT variant error: Case says which case it holds.

func ErrorDenied

func ErrorDenied(v string) Error

ErrorDenied is the denied case of Error, holding v.

func ErrorNoSuchBucket

func ErrorNoSuchBucket() Error

ErrorNoSuchBucket is the no-such-bucket case of Error.

func (Error) Denied

func (x Error) Denied() (string, bool)

Denied is the denied case's payload, and whether x holds that case.

type ErrorCase

type ErrorCase uint32

ErrorCase is a case of Error.

const (
	ErrorCaseNoSuchBucket ErrorCase = 0
	ErrorCaseDenied       ErrorCase = 1
)

type Imports

type Imports struct {
	Kv Kv
}

Imports are the host's implementations of the world's imports.

type Kv

type Kv interface {
	NewBucket(ctx context.Context, name string) (Bucket, error)
	BucketPut(ctx context.Context, self Bucket, key string, value []byte) error
	BucketGet(ctx context.Context, self Bucket, key string) (*[]byte, error)
	ListKeys(ctx context.Context, b Bucket) (witgo.Result[[]string, Error], error)
	// DropBucket releases a Bucket the guest dropped.
	DropBucket(ctx context.Context, self Bucket) error
}

Kv is the host's implementation of example:store/kv@1.0.0.

Directories

Path Synopsis
tree
app
Package app binds the WIT world app.
Package app binds the WIT world app.
example/store/v1.0.0/kv
Package kv binds the WIT interface example:store/kv@1.0.0, for a host implementing it.
Package kv binds the WIT interface example:store/kv@1.0.0, for a host implementing it.
Package with binds the WIT world app.
Package with binds the WIT world app.

Jump to

Keyboard shortcuts

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