wasm

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package wasm provides WASM-specific adapters implementing domain ports. These adapters handle the details of host function communication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSAdapter

type DNSAdapter struct{}

DNSAdapter stub for native builds.

func NewDNSAdapter

func NewDNSAdapter(nameserver string, timeout time.Duration) *DNSAdapter

func (*DNSAdapter) Lookup

func (r *DNSAdapter) Lookup(ctx context.Context, hostname, recordType string) (*entities.DNSResponse, error)

func (*DNSAdapter) LookupCNAME

func (r *DNSAdapter) LookupCNAME(ctx context.Context, host string) (string, error)

func (*DNSAdapter) LookupHost

func (r *DNSAdapter) LookupHost(ctx context.Context, host string) ([]string, error)

func (*DNSAdapter) LookupMX

func (r *DNSAdapter) LookupMX(ctx context.Context, domain string) ([]ports.MXRecord, error)

func (*DNSAdapter) LookupNS

func (r *DNSAdapter) LookupNS(ctx context.Context, domain string) ([]string, error)

func (*DNSAdapter) LookupTXT

func (r *DNSAdapter) LookupTXT(ctx context.Context, domain string) ([]string, error)

type ExecAdapter

type ExecAdapter struct{}

ExecAdapter stub for native builds.

func NewExecAdapter

func NewExecAdapter() *ExecAdapter

NewExecAdapter creates a new ExecAdapter stub.

func (*ExecAdapter) Run

Run panics because WASM execution is not available natively.

type HTTPAdapter

type HTTPAdapter struct{}

HTTPAdapter stub for native builds.

func NewHTTPAdapter

func NewHTTPAdapter(defaultTimeout time.Duration) *HTTPAdapter

func (*HTTPAdapter) Do

func (*HTTPAdapter) Get

func (c *HTTPAdapter) Get(ctx context.Context, url string) (*ports.HTTPResponse, error)

func (*HTTPAdapter) Post

func (c *HTTPAdapter) Post(ctx context.Context, url string, contentType string, body []byte) (*ports.HTTPResponse, error)

type SMTPAdapter

type SMTPAdapter struct{}

SMTPAdapter stub for native builds.

func NewSMTPAdapter

func NewSMTPAdapter() *SMTPAdapter

func (*SMTPAdapter) Connect

func (a *SMTPAdapter) Connect(ctx context.Context, host, port string, timeout time.Duration, useTLS, useStartTLS bool) (*ports.SMTPConnectResult, error)

type TCPAdapter

type TCPAdapter struct{}

TCPAdapter implements ports.TCPDialer for the native environment (stub). This allows compiling the SDK on non-WASM targets (e.g. for running tests).

func NewTCPAdapter

func NewTCPAdapter() *TCPAdapter

NewTCPAdapter creates a new TCP adapter stub.

func (*TCPAdapter) Dial

func (a *TCPAdapter) Dial(ctx context.Context, address string) (ports.TCPConnection, error)

Dial panics because real WASM calls are not supported natively.

func (*TCPAdapter) DialSecure added in v0.2.3

func (a *TCPAdapter) DialSecure(ctx context.Context, address string, timeoutMs int, tls bool) (ports.TCPConnection, error)

DialSecure panics because real WASM calls are not supported natively.

func (*TCPAdapter) DialWithTimeout

func (a *TCPAdapter) DialWithTimeout(ctx context.Context, address string, timeoutMs int) (ports.TCPConnection, error)

DialWithTimeout panics because real WASM calls are not supported natively.

Jump to

Keyboard shortcuts

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