transports

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAlreadyRegistered error when registering a transport that matches
	// an already registered ID or name.
	ErrAlreadyRegistered = errors.New("transport already registered")

	// ErrUnknownTransport provided id or name does npt match any enabled
	// transport.
	ErrUnknownTransport = errors.New("unknown transport")
)

Functions

func AddTransport

func AddTransport(build func() cj.Transport) error

AddTransport adds new transport

func ConfigFromTransportType

func ConfigFromTransportType(transportType pb.TransportType, randomizePortDefault bool) (cj.Transport, error)

func EnableDefaultTransports

func EnableDefaultTransports() error

EnableDefaultTransports initializes the library with default transports

func GetTransportByID

func GetTransportByID(id pb.TransportType) (cj.Transport, bool)

GetTransportByID returns transport by name

func GetTransportByName

func GetTransportByName(name string) (cj.Transport, bool)

GetTransportByName returns transport by name

func New

func New(name string) (cj.Transport, error)

New returns a new Transport

func NewWithParams

func NewWithParams(name string, params any) (cj.Transport, error)

NewWithParams returns a new Transport and attempts to set the parameters provided

func NewWithParamsByID added in v0.6.1

func NewWithParamsByID(id pb.TransportType, params any) (cj.Transport, error)

NewWithParamsByID returns a new Transport by Type ID, if one exists, and attempts to set the parameters provided.

Types

This section is empty.

Jump to

Keyboard shortcuts

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