rlkclient

package
v28.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PortDriverClient

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

func NewPortDriverClient

func NewPortDriverClient(ctx context.Context) (*PortDriverClient, error)

func (*PortDriverClient) AddPort

func (c *PortDriverClient) AddPort(
	ctx context.Context,
	proto string,
	hostIP netip.Addr,
	childIP netip.Addr,
	hostPort int,
) (func() error, error)

AddPort makes a request to RootlessKit asking it to set up a port mapping between a host IP address and a child host IP address.

AddPort may return ProtocolUnsupportedError.

func (*PortDriverClient) ChildHostIP

func (c *PortDriverClient) ChildHostIP(hostIP netip.Addr) netip.Addr

ChildHostIP returns the address that must be used in the child network namespace in place of hostIP, a host IP address. In particular, port mappings from host IP addresses, and DNAT rules, must use this child address in place of the real host address.

type ProtocolUnsupportedError

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

ProtocolUnsupportedError is returned when apiProto is not supported by portDriverName.

func (*ProtocolUnsupportedError) Error

func (e *ProtocolUnsupportedError) Error() string

Jump to

Keyboard shortcuts

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