chain

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 added in v0.0.3

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

func NewRouter added in v0.0.3

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

func (*Router) Bind added in v0.0.3

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

func (*Router) Dial added in v0.0.3

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

func (*Router) Options added in v0.0.3

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

type Transport added in v0.0.3

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

func NewTransport added in v0.0.3

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

func (*Transport) Bind added in v0.0.3

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

func (*Transport) Connect added in v0.0.3

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

func (*Transport) Copy added in v0.0.3

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

func (*Transport) Dial added in v0.0.3

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

func (*Transport) Handshake added in v0.0.3

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

func (*Transport) Multiplex added in v0.0.3

func (tr *Transport) Multiplex() bool

func (*Transport) Options added in v0.0.3

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

Jump to

Keyboard shortcuts

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