Documentation ¶
Overview ¶
Package patchpanel interacts with the patchpanel system daemon.
Index ¶
- type Client
- func (c *Client) ConnectNamespace(ctx context.Context, pid int32, outboundPhysicalDevice string, ...) (local *os.File, response *pp.ConnectNamespaceResponse, retErr error)
- func (c *Client) GetDevices(ctx context.Context) (*pp.GetDevicesResponse, error)
- func (c *Client) NotifyTerminaVMShutdown(ctx context.Context, cid uint32) error
- func (c *Client) NotifyTerminaVMStartup(ctx context.Context, cid uint32) (response *pp.TerminaVmStartupResponse, retErr error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper around patchpanel DBus API.
func New ¶
New connects to the patchpanel daemon via D-Bus and returns a patchpanel Client object. TODO(crbug.com/1135106): Implement missing patchpanel D-Bus API methods.
func (*Client) ConnectNamespace ¶
func (c *Client) ConnectNamespace(ctx context.Context, pid int32, outboundPhysicalDevice string, forwardUserTraffic bool) (local *os.File, response *pp.ConnectNamespaceResponse, retErr error)
ConnectNamespace sends a ConnectNamespaceRequest for the given namespace pid. Returns a pair with a open file descriptor and the ConnectNamespaceResponse proto message received if the request succeeded. Closing the file descriptor will teardown the veth and routing setup and free the allocated IPv4 subnet.
func (*Client) GetDevices ¶
GetDevices gets all patchpanel managed devices information.
func (*Client) NotifyTerminaVMShutdown ¶
NotifyTerminaVMShutdown sends a TerminaVmShutdownRequest for the given container id.
func (*Client) NotifyTerminaVMStartup ¶
func (c *Client) NotifyTerminaVMStartup(ctx context.Context, cid uint32) (response *pp.TerminaVmStartupResponse, retErr error)
NotifyTerminaVMStartup sends a TerminaVmStartupRequest for the given container id. The ID must be unique in the system.