chain

package
v0.2.19 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 20 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultRoute chain.Route = &defaultRoute{}
)
View Source
var (
	ErrEmptyRoute = errors.New("empty route")
)

Functions

func NewChainGroup

func NewChainGroup(chains ...chain.Chainer) *chainGroup

func NewRoute

func NewRoute(opts ...RouteOption) *chainRoute

Types

type Chain

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

func NewChain

func NewChain(name string, opts ...ChainOption) *Chain

func (*Chain) AddHop

func (c *Chain) AddHop(hop hop.Hop)

func (*Chain) Marker

func (c *Chain) Marker() selector.Marker

Marker implements selector.Markable interface.

func (*Chain) Metadata

func (c *Chain) Metadata() metadata.Metadata

Metadata implements metadata.Metadatable interface.

func (*Chain) Name

func (c *Chain) Name() string

func (*Chain) Route

func (c *Chain) Route(ctx context.Context, network, address string, opts ...chain.RouteOption) chain.Route

type ChainOption

type ChainOption func(*ChainOptions)

func LoggerChainOption

func LoggerChainOption(logger logger.Logger) ChainOption

func MetadataChainOption

func MetadataChainOption(md metadata.Metadata) ChainOption

type ChainOptions

type ChainOptions struct {
	Metadata metadata.Metadata
	Logger   logger.Logger
}

type RouteOption

type RouteOption func(*RouteOptions)

func ChainRouteOption

func ChainRouteOption(c chain.Chainer) RouteOption

type RouteOptions

type RouteOptions struct {
	Chain chain.Chainer
}

type Router

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

func NewRouter

func NewRouter(opts ...chain.RouterOption) *Router

func (*Router) Bind

func (r *Router) Bind(ctx context.Context, network, address string, opts ...chain.BindOption) (ln net.Listener, err error)

func (*Router) Dial

func (r *Router) Dial(ctx context.Context, network, address string) (conn net.Conn, err error)

func (*Router) Options

func (r *Router) Options() *chain.RouterOptions

type Transport

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

func NewTransport

func NewTransport(d dialer.Dialer, c connector.Connector, opts ...chain.TransportOption) *Transport

func (*Transport) Bind

func (tr *Transport) Bind(ctx context.Context, conn net.Conn, network, address string, opts ...connector.BindOption) (net.Listener, error)

func (*Transport) Connect

func (tr *Transport) Connect(ctx context.Context, conn net.Conn, network, address string) (net.Conn, error)

func (*Transport) Copy

func (tr *Transport) Copy() chain.Transporter

func (*Transport) Dial

func (tr *Transport) Dial(ctx context.Context, addr string) (net.Conn, error)

func (*Transport) Handshake

func (tr *Transport) Handshake(ctx context.Context, conn net.Conn) (net.Conn, error)

func (*Transport) Multiplex

func (tr *Transport) Multiplex() bool

func (*Transport) Options

func (tr *Transport) Options() *chain.TransportOptions

Jump to

Keyboard shortcuts

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