transport

package
v0.0.0-...-c18a219 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(ctx context.Context, addr Address) (net.Conn, error)

func Listen

func Listen(addr Address) (net.Listener, error)

func RegisterDialer

func RegisterDialer(schema string, dialer Dialer)

func RegisterListener

func RegisterListener(schema string, listener Listener)

Types

type Address

type Address struct {
	URL     string   `json:"url"` // http://10.10.30.1, tcp://10.10.30.1, tls://10.10.30.1, quic://10.10.30.1, ss://10.10.30.1
	Options data.Map `json:"options"`
}

type Dialer

type Dialer interface {
	Dial(ctx context.Context, host string, opts data.Map) (net.Conn, error)
}

type Listener

type Listener interface {
	Listen(addr string, opts data.Map) (net.Listener, error)
}

Jump to

Keyboard shortcuts

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