...

Package sock

import "github.com/tetratelabs/wazero/experimental/sock"
Overview
Index

Overview ▾

func WithConfig

func WithConfig(ctx context.Context, config Config) context.Context

WithConfig registers the given Config into the given context.Context.

type Config

Config configures the host to open TCP sockets and allows guest access to them.

Instantiating a module with listeners results in pre-opened sockets associated with file-descriptors numerically after pre-opened files.

type Config interface {
    // WithTCPListener configures the host to set up the given host:port listener.
    WithTCPListener(host string, port int) Config
}

func NewConfig

func NewConfig() Config

NewConfig returns a Config for module instantiation.