Documentation
¶
Overview ¶
Package wasm provides WASM-specific adapters implementing domain ports. These adapters handle the details of host function communication.
Index ¶
- type DNSAdapter
- func (r *DNSAdapter) Lookup(ctx context.Context, hostname, recordType string) (*entities.DNSResponse, error)
- func (r *DNSAdapter) LookupCNAME(ctx context.Context, host string) (string, error)
- func (r *DNSAdapter) LookupHost(ctx context.Context, host string) ([]string, error)
- func (r *DNSAdapter) LookupMX(ctx context.Context, domain string) ([]ports.MXRecord, error)
- func (r *DNSAdapter) LookupNS(ctx context.Context, domain string) ([]string, error)
- func (r *DNSAdapter) LookupTXT(ctx context.Context, domain string) ([]string, error)
- type ExecAdapter
- type HTTPAdapter
- func (c *HTTPAdapter) Do(ctx context.Context, req ports.HTTPRequest) (*ports.HTTPResponse, error)
- func (c *HTTPAdapter) Get(ctx context.Context, url string) (*ports.HTTPResponse, error)
- func (c *HTTPAdapter) Post(ctx context.Context, url string, contentType string, body []byte) (*ports.HTTPResponse, error)
- type SMTPAdapter
- type TCPAdapter
- func (a *TCPAdapter) Dial(ctx context.Context, address string) (ports.TCPConnection, error)
- func (a *TCPAdapter) DialSecure(ctx context.Context, address string, timeoutMs int, tls bool) (ports.TCPConnection, error)
- func (a *TCPAdapter) DialWithTimeout(ctx context.Context, address string, timeoutMs int) (ports.TCPConnection, error)
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 (*DNSAdapter) LookupHost ¶
type ExecAdapter ¶
type ExecAdapter struct{}
ExecAdapter stub for native builds.
func NewExecAdapter ¶
func NewExecAdapter() *ExecAdapter
NewExecAdapter creates a new ExecAdapter stub.
func (*ExecAdapter) Run ¶
func (a *ExecAdapter) Run(ctx context.Context, req ports.CommandRequest) (*ports.CommandResult, error)
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 (c *HTTPAdapter) Do(ctx context.Context, req ports.HTTPRequest) (*ports.HTTPResponse, error)
func (*HTTPAdapter) Get ¶
func (c *HTTPAdapter) Get(ctx context.Context, url string) (*ports.HTTPResponse, error)
type SMTPAdapter ¶
type SMTPAdapter struct{}
SMTPAdapter stub for native builds.
func NewSMTPAdapter ¶
func NewSMTPAdapter() *SMTPAdapter
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 (*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.