transport

package
v0.0.0-...-b02c517 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option = func(*Options)

func TLSConfig

func TLSConfig(c *tls.Config) Option

type Options

type Options struct {
	TLSConfig *tls.Config
}

type Transport

type Transport interface {
	// Init initializes the transport.
	Init(...Option)
	// String returns the implementation name.
	String() string
	// Dial connects to an address. A context is used for timing out
	// the creation of the connection.
	Dial(context.Context, string) (net.Conn, error)
	// Listen returns a listener. A context is used for timing out
	// the creation of the listener.
	Listen(context.Context, string) (net.Listener, error)
}

Transport is a transport agnostic abstraction used by the client to connect to an address of the server.

var Default Transport

Default is the transport instance to be auto wired.

func NewMemory

func NewMemory(opts ...Option) Transport

func NewTCP

func NewTCP(opts ...Option) Transport

Jump to

Keyboard shortcuts

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