netconn

package
v0.0.0-...-c7154f0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package netconn provides both client and server implementations using/for rc.RemoteControlClient's NetConn method.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	API         ClientAPI
	Timeout     time.Duration
	ClosePolicy streamutil.ClosePolicy
}

Client implements Dialer using rc.RemoteControlClient's NetConn method.

func (*Client) DialContext

func (x *Client) DialContext(ctx context.Context, network, address string) (net.Conn, error)

type ClientAPI

type ClientAPI interface {
	NetConn(ctx context.Context, opts ...grpc.CallOption) (rc.RemoteControl_NetConnClient, error)
}

ClientAPI models a subset of rc.RemoteControlClient, as used by Client.

type Dialer

type Dialer interface {
	DialContext(ctx context.Context, network, address string) (net.Conn, error)
}

Dialer models an implementation like net.Dialer. See also DialerFactory.

type DialerFactory

type DialerFactory func(req *rc.NetConnRequest_Dial) (Dialer, error)

DialerFactory prepares a Dialer based on a dial request. See also DefaultDialer.

var (
	// DefaultDialer will be used by Server.NetConn if Server.Dialer is nil.
	DefaultDialer DialerFactory = defaultDialer
)

type Server

type Server struct {
	Dialer DialerFactory
	// contains filtered or unexported fields
}

Server implements rc.RemoteControlServer's NetConn method.

func (*Server) NetConn

func (x *Server) NetConn(stream rc.RemoteControl_NetConnServer) error

type ServerAPI

type ServerAPI interface {
	NetConn(stream rc.RemoteControl_NetConnServer) error
}

ServerAPI models a subset of rc.RemoteControlServer, as implemented by Server.

Jump to

Keyboard shortcuts

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