client

package
v0.0.0-...-b4360e7 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VSockSocketScheme     = "vsock"
	HybridVSockScheme     = "hvsock"
	RemoteSockScheme      = "remote"
	MockHybridVSockScheme = "mock"
)

Variables

This section is empty.

Functions

func HybridVSockDialer

func HybridVSockDialer(sock string, timeout time.Duration) (net.Conn, error)

HybridVSockDialer dials to a hybrid virtio socket

func MockHybridVSockDialer

func MockHybridVSockDialer(sock string, timeout time.Duration) (net.Conn, error)

just for tests use.

func RemoteSockDialer

func RemoteSockDialer(sock string, timeout time.Duration) (net.Conn, error)

RemoteSockDialer dials to an agent in a remote hypervisor sandbox

func TraceUnaryClientInterceptor

func TraceUnaryClientInterceptor() ttrpc.UnaryClientInterceptor

func VsockDialer

func VsockDialer(sock string, timeout time.Duration) (net.Conn, error)

Types

type AgentClient

type AgentClient struct {
	AgentServiceClient agentgrpc.AgentServiceService
	HealthClient       agentgrpc.HealthService
	// contains filtered or unexported fields
}

AgentClient is an agent gRPC client connection wrapper for agentgrpc.AgentServiceClient

func NewAgentClient

func NewAgentClient(ctx context.Context, sock string, timeout uint32) (*AgentClient, error)

NewAgentClient creates a new agent gRPC client and handles both unix and vsock addresses.

Supported sock address formats are:

  • vsock://<cid>:<port>
  • hvsock://<path>:<port>. Firecracker implements the virtio-vsock device model, and mediates communication between AF_UNIX sockets (on the host end) and AF_VSOCK sockets (on the guest end).
  • mock://<path>. just for test use.

func (*AgentClient) Close

func (c *AgentClient) Close() error

Close an existing connection to the agent gRPC server.

Jump to

Keyboard shortcuts

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