system

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: Apache-2.0, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap[T ~capnp.ClientKind](ctx context.Context, h local.Host, d Dialer) (T, error)

func Instantiate

func Instantiate[T ~capnp.ClientKind](ctx context.Context, r wazero.Runtime, t T) (*wazergo.ModuleInstance[*NetSock], context.Context, error)

Instantiate the system host module. If instantiation fails, the returned context is expired, and the ctx.Err() method returns the offending error.

Types

type Closer

type Closer struct {
	api.Closer
	Next *Closer
}

func Init

func Init[T ~capnp.ClientKind](ctx context.Context, r wazero.Runtime, t T) (c Closer, out context.Context, err error)

func (Closer) Close

func (c Closer) Close(ctx context.Context) (err error)

type Dialer

type Dialer interface {
	DialRPC(context.Context, local.Host) (*rpc.Conn, error)
}

type Error

type Error struct {
	Module string
	Cause  error
}

func (Error) Error

func (err Error) Error() string

func (Error) Unwrap

func (err Error) Unwrap() error

type ErrorReporter

type ErrorReporter struct {
	log.Logger
}

ErrorReporter handles Cap'n Proto RPC errors.

func (ErrorReporter) ReportError

func (r ErrorReporter) ReportError(err error)

type Module

type Module[T ~capnp.ClientKind] interface {
	Instantiate(ctx context.Context, r wazero.Runtime, t T) (api.Closer, context.Context, error)
}

type NetSock

type NetSock struct {
	Addr            net.Addr
	Logger          log.Logger
	BootstrapClient capnp.Client
	// contains filtered or unexported fields
}

NetSock is a system socket that uses the host's IP stack.

func (*NetSock) Close

func (sock *NetSock) Close(context.Context) error

type Option

type Option = wazergo.Option[*NetSock]

Jump to

Keyboard shortcuts

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