net

package
v0.2.4 Latest Latest
Warning

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

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

Documentation

Overview

Package net is the socket capability: the kernel I/O tier's network boundary. Opening a listener or dialing a connection crosses out of the process's shared memory into the kernel, so it happens only through a capability granted by the binary that owns the process.

A binary constructs one HostNetwork and passes it, as an IListener or an IDialer, to whatever needs it; a service receives the capability in its constructor and never calls net.Listen or net.Dial itself. The narrower protocol capabilities, candace/ipc/net/http and candace/ipc/net/grpc, are built on these two interfaces, which is also what lets a test replace the kernel with an in-memory pipe.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostNetwork

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

HostNetwork is this host's kernel network stack, granted as a capability.

func NewHostNetwork

func NewHostNetwork() *HostNetwork

NewHostNetwork returns the host's network capability with the standard library's defaults.

func (*HostNetwork) DialContext

func (network *HostNetwork) DialContext(ctx context.Context, kind string, address string) (stdnet.Conn, error)

DialContext opens a connection to address.

func (*HostNetwork) Listen

func (network *HostNetwork) Listen(ctx context.Context, kind string, address string) (stdnet.Listener, error)

Listen opens a listener on address.

type IDialer

type IDialer interface {
	DialContext(ctx context.Context, network string, address string) (stdnet.Conn, error)
}

IDialer opens outbound connections.

type IListener

type IListener interface {
	Listen(ctx context.Context, network string, address string) (stdnet.Listener, error)
}

IListener opens listening sockets.

Directories

Path Synopsis
Package grpc is the gRPC client-connection capability.
Package grpc is the gRPC client-connection capability.
Package http is the HTTP capability: one server bound to one address, mounted into the process runtime as a service, and the outbound client (NewHTTPClient) whose every connection is dialed through a granted socket capability.
Package http is the HTTP capability: one server bound to one address, mounted into the process runtime as a service, and the outbound client (NewHTTPClient) whose every connection is dialed through a granted socket capability.

Jump to

Keyboard shortcuts

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