socketforward

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package socketforward defines the socketforward service.

Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. source: proto/nerdbox/services/socketforward/v1/socketforward.proto

Index

Constants

This section is empty.

Variables

View Source
var File_proto_nerdbox_services_socketforward_v1_socketforward_proto protoreflect.FileDescriptor

Functions

func RegisterTTRPCSocketForwardService

func RegisterTTRPCSocketForwardService(srv *ttrpc.Server, svc TTRPCSocketForwardService)

Types

type BindRequest

type BindRequest struct {
	Sockets []*Socket `protobuf:"bytes,1,rep,name=sockets,proto3" json:"sockets,omitempty"`
	// contains filtered or unexported fields
}

BindRequest is sent by the host before container creation to set up socket forwards on the VM side.

func (*BindRequest) Descriptor deprecated

func (*BindRequest) Descriptor() ([]byte, []int)

Deprecated: Use BindRequest.ProtoReflect.Descriptor instead.

func (*BindRequest) GetSockets

func (x *BindRequest) GetSockets() []*Socket

func (*BindRequest) ProtoMessage

func (*BindRequest) ProtoMessage()

func (*BindRequest) ProtoReflect

func (x *BindRequest) ProtoReflect() protoreflect.Message

func (*BindRequest) Reset

func (x *BindRequest) Reset()

func (*BindRequest) String

func (x *BindRequest) String() string

type ConnectRequest

type ConnectRequest struct {

	// ID of the vsock stream. The host must open a stream with this ID after
	// a successful ConnectResult so that the relay can start.
	StreamID string `protobuf:"bytes,1,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"`
	// Identifier of the socket forward entry. The host uses this to resolve the
	// target host socket path from its own configuration rather than trusting a
	// path supplied by the VM.
	ForwardID string `protobuf:"bytes,2,opt,name=forward_id,json=forwardId,proto3" json:"forward_id,omitempty"`
	// contains filtered or unexported fields
}

ConnectRequest is sent by the VM on the Accept stream to notify the host of a new container-initiated connection.

func (*ConnectRequest) Descriptor deprecated

func (*ConnectRequest) Descriptor() ([]byte, []int)

Deprecated: Use ConnectRequest.ProtoReflect.Descriptor instead.

func (*ConnectRequest) GetForwardID

func (x *ConnectRequest) GetForwardID() string

func (*ConnectRequest) GetStreamID

func (x *ConnectRequest) GetStreamID() string

func (*ConnectRequest) ProtoMessage

func (*ConnectRequest) ProtoMessage()

func (*ConnectRequest) ProtoReflect

func (x *ConnectRequest) ProtoReflect() protoreflect.Message

func (*ConnectRequest) Reset

func (x *ConnectRequest) Reset()

func (*ConnectRequest) String

func (x *ConnectRequest) String() string

type ConnectResult

type ConnectResult struct {

	// ID of the vsock stream from the corresponding ConnectRequest.
	StreamID string `protobuf:"bytes,1,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"`
	// Non-empty if the host failed to dial the target socket. The VM closes
	// the pending connection when error is set.
	Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

ConnectResult is sent by the host on the Accept stream in response to each ConnectRequest. It reports whether the host successfully dialed the target socket. On failure the VM closes the pending container connection immediately.

func (*ConnectResult) Descriptor deprecated

func (*ConnectResult) Descriptor() ([]byte, []int)

Deprecated: Use ConnectResult.ProtoReflect.Descriptor instead.

func (*ConnectResult) GetError

func (x *ConnectResult) GetError() string

func (*ConnectResult) GetStreamID

func (x *ConnectResult) GetStreamID() string

func (*ConnectResult) ProtoMessage

func (*ConnectResult) ProtoMessage()

func (*ConnectResult) ProtoReflect

func (x *ConnectResult) ProtoReflect() protoreflect.Message

func (*ConnectResult) Reset

func (x *ConnectResult) Reset()

func (*ConnectResult) String

func (x *ConnectResult) String() string

type Socket

type Socket struct {

	// Opaque identifier for this forward. Each side uses it to resolve the local
	// socket path from its own configuration.
	ForwardID string `protobuf:"bytes,1,opt,name=forward_id,json=forwardId,proto3" json:"forward_id,omitempty"`
	// Path of the UNIX listener socket in the VM's root filesystem (e.g.
	// /run/socketfwd/{forward_id}.sock). vminitd creates the socket here;
	// the shim has already rewritten the uds mount to a bind mount from
	// this path to the user-specified destination inside the container.
	SocketPath string `protobuf:"bytes,2,opt,name=socket_path,json=socketPath,proto3" json:"socket_path,omitempty"`
	// contains filtered or unexported fields
}

Socket describes a single forwarded UNIX socket.

func (*Socket) Descriptor deprecated

func (*Socket) Descriptor() ([]byte, []int)

Deprecated: Use Socket.ProtoReflect.Descriptor instead.

func (*Socket) GetForwardID

func (x *Socket) GetForwardID() string

func (*Socket) GetSocketPath

func (x *Socket) GetSocketPath() string

func (*Socket) ProtoMessage

func (*Socket) ProtoMessage()

func (*Socket) ProtoReflect

func (x *Socket) ProtoReflect() protoreflect.Message

func (*Socket) Reset

func (x *Socket) Reset()

func (*Socket) String

func (x *Socket) String() string

type TTRPCSocketForwardClient

type TTRPCSocketForwardClient interface {
	Bind(context.Context, *BindRequest) (*emptypb.Empty, error)
	Accept(context.Context) (TTRPCSocketForward_AcceptClient, error)
}

func NewTTRPCSocketForwardClient

func NewTTRPCSocketForwardClient(client *ttrpc.Client) TTRPCSocketForwardClient

type TTRPCSocketForwardService

type TTRPCSocketForwardService interface {
	Bind(context.Context, *BindRequest) (*emptypb.Empty, error)
	Accept(context.Context, TTRPCSocketForward_AcceptServer) error
}

type TTRPCSocketForward_AcceptClient

type TTRPCSocketForward_AcceptClient interface {
	Send(*ConnectResult) error
	Recv() (*ConnectRequest, error)
	ttrpc.ClientStream
}

type TTRPCSocketForward_AcceptServer

type TTRPCSocketForward_AcceptServer interface {
	Send(*ConnectRequest) error
	Recv() (*ConnectResult, error)
	ttrpc.StreamServer
}

Jump to

Keyboard shortcuts

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