usernet

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: Apache-2.0 Imports: 27 Imported by: 4

Documentation

Index

Constants

View Source
const (
	FDSock       = "fd"
	QEMUSock     = "qemu"
	EndpointSock = "ep"
)

Variables

This section is empty.

Functions

func PIDFile

func PIDFile(name string) (string, error)

PIDFile returns a path for usernet PID file

func Sock

func Sock(name string, sockType SockType) (string, error)

Sock returns a usernet socket based on name and sockType.

func SockWithDirectory

func SockWithDirectory(dir string, name string, sockType SockType) (string, error)

SockWithDirectory return a usernet socket based on dir, name and sockType

func Start

func Start(ctx context.Context, name string) error

Start starts a instance a usernet network with the given name. The name parameter must point to a valid network configuration name under <LIMA_HOME>/_config/networks.yaml with `mode: user-v2`

func StartGVisorNetstack

func StartGVisorNetstack(ctx context.Context, gVisorOpts *GVisorNetstackOpts) error

func Stop

func Stop(name string) error

Stop stops running instance a usernet network with the given name. The name parameter must point to a valid network configuration name under <LIMA_HOME>/_config/networks.yaml with `mode: user-v2`

Types

type Client

type Client struct {
	Directory string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpointSock string) *Client

func (*Client) ResolveAndForwardSSH

func (c *Client) ResolveAndForwardSSH(vmMacAddr string, sshPort int) error

func (*Client) UnExposeSSH

func (c *Client) UnExposeSSH(sshPort int) error

type GVisorNetstackOpts

type GVisorNetstackOpts struct {
	MTU int

	QemuSocket string
	FdSocket   string
	Endpoint   string

	Async bool

	DefaultLeases map[string]string
}

type SockType

type SockType = string

type UDPFileConn

type UDPFileConn struct {
	net.Conn
}

func (*UDPFileConn) Read

func (conn *UDPFileConn) Read(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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