package msg
import "github.com/rootless-containers/rootlesskit/pkg/port/builtin/msg"
Index ¶
- Constants
- func ConnectToChild(c *net.UnixConn, spec port.Spec) (int, error)
- func ConnectToChildWithRetry(socketPath string, spec port.Spec, retries int) (int, error)
- func ConnectToChildWithSocketPath(socketPath string, spec port.Spec) (int, error)
- func Initiate(c *net.UnixConn) error
- type Reply
- type Request
Constants ¶
const ( RequestTypeInit = "init" RequestTypeConnect = "connect" )
Functions ¶
func ConnectToChild ¶
ConnectToChild connects to the child UNIX socket, and obtains TCP or UDP socket FD that corresponds to the port spec.
func ConnectToChildWithRetry ¶
ConnectToChildWithRetry retries ConnectToChild every (i*5) milliseconds.
func ConnectToChildWithSocketPath ¶
ConnectToChildWithSocketPath wraps ConnectToChild
func Initiate ¶
Initiate sends "init" request to the child UNIX socket.
Types ¶
type Reply ¶
type Reply struct { Error string }
Reply may contain FD as OOB
type Request ¶
type Request struct { Type string // "init" or "connect" Proto string // "tcp", "tcp4", "tcp6", "udp", "udp4", "udp6" IP string Port int }
Request and Response are encoded as JSON with uint32le length header.
Source Files ¶
- Version
- v1.1.1 (latest)
- Published
- May 30, 2023
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 3 weeks ago –
Tools for package owners.