dialers

package
v1.0.1-0...-3379034 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStreamAsConn

func NewStreamAsConn(s ClientOrServerStream) io.ReadWriteCloser

用于把 GRPC STREAM 连接转换成连续的 读/写 接口。

Types

type ClientOrServerStream

type ClientOrServerStream interface {
	Send(*proto.DialRemoteMessage) error
	Recv() (*proto.DialRemoteMessage, error)
}

type DialRemoteRequest

type DialRemoteRequest struct {
	Addr string
}

type DialRemoteResponse

type DialRemoteResponse struct {
	Error string
}

type RemoteDialerManager

type RemoteDialerManager struct {
	// contains filtered or unexported fields
}

func NewRemoteDialerManager

func NewRemoteDialerManager(s ClientOrServerStream) *RemoteDialerManager

func (*RemoteDialerManager) Dial

func (m *RemoteDialerManager) Dial(addr string) (net.Conn, error)

func (*RemoteDialerManager) Run

func (m *RemoteDialerManager) Run() error

type StreamAsConn

type StreamAsConn struct {
	// contains filtered or unexported fields
}

func (*StreamAsConn) Close

func (c *StreamAsConn) Close() error

只有 client 需要关,那就自行关。

func (*StreamAsConn) Read

func (c *StreamAsConn) Read(p []byte) (int, error)

func (*StreamAsConn) Write

func (c *StreamAsConn) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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