Documentation ¶
Index ¶
- Variables
- func Resolve(ctx context.Context, network, addr string, r resolver.IResolver, ...) (string, error)
- type BindOption
- func BacklogBindOption(backlog int) BindOption
- func LoggerBindOption(logger logger.ILogger) BindOption
- func MuxBindOption(mux bool) BindOption
- func UDPConnTTLBindOption(ttl time.Duration) BindOption
- func UDPDataBufferSizeBindOption(size int) BindOption
- func UDPDataQueueSizeBindOption(size int) BindOption
- type BindOptions
- type DialOption
- type DialOptions
- type HTTPNodeSettings
- type HTTPURLRewriteSetting
- type IChainer
- type IRoute
- type Node
- type NodeOption
- func BypassNodeOption(bp bypass.IBypass) NodeOption
- func HTTPNodeOption(httpSettings *HTTPNodeSettings) NodeOption
- func HostMapperNodeOption(m hosts.IHostMapper) NodeOption
- func HostNodeOption(host string) NodeOption
- func MetadataNodeOption(md metadata.IMetaData) NodeOption
- func NetworkNodeOption(network string) NodeOption
- func PathNodeOption(path string) NodeOption
- func ProtocolNodeOption(protocol string) NodeOption
- func ResoloverNodeOption(resolver resolver.IResolver) NodeOption
- func TLSNodeOption(tlsSettings *TLSNodeSettings) NodeOption
- func TransportNodeOption(tr *Transport) NodeOption
- type NodeOptions
- type RouteOption
- type RouteOptions
- type Router
- type RouterOption
- func ChainRouterOption(chain IChainer) RouterOption
- func HostMapperRouterOption(m hosts.IHostMapper) RouterOption
- func InterfaceRouterOption(ifceName string) RouterOption
- func LoggerRouterOption(logger logger.ILogger) RouterOption
- func RecordersRouterOption(recorders ...recorder.RecorderObject) RouterOption
- func ResolverRouterOption(resolver resolver.IResolver) RouterOption
- func RetriesRouterOption(retries int) RouterOption
- func SockOptsRouterOption(so *SockOpts) RouterOption
- func TimeoutRouterOption(timeout time.Duration) RouterOption
- type RouterOptions
- type SockOpts
- type TLSNodeSettings
- type Transport
- func (tr *Transport) Bind(ctx context.Context, conn net.Conn, network, address string, ...) (net.Listener, error)
- func (tr *Transport) Connect(ctx context.Context, conn net.Conn, network, address string) (net.Conn, error)
- func (tr *Transport) Copy() *Transport
- func (tr *Transport) Dial(ctx context.Context, addr string) (net.Conn, error)
- func (tr *Transport) Handshake(ctx context.Context, conn net.Conn) (net.Conn, error)
- func (tr *Transport) Multiplex() bool
- func (tr *Transport) Options() *TransportOptions
- type TransportOption
- type TransportOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrEmptyRoute = errors.New("empty route")
)
Functions ¶
Types ¶
type BindOption ¶
type BindOption func(opts *BindOptions)
func BacklogBindOption ¶
func BacklogBindOption(backlog int) BindOption
func LoggerBindOption ¶
func LoggerBindOption(logger logger.ILogger) BindOption
func MuxBindOption ¶
func MuxBindOption(mux bool) BindOption
func UDPConnTTLBindOption ¶
func UDPConnTTLBindOption(ttl time.Duration) BindOption
func UDPDataBufferSizeBindOption ¶
func UDPDataBufferSizeBindOption(size int) BindOption
func UDPDataQueueSizeBindOption ¶
func UDPDataQueueSizeBindOption(size int) BindOption
type BindOptions ¶
type DialOption ¶
type DialOption func(opts *DialOptions)
func InterfaceDialOption ¶
func InterfaceDialOption(ifName string) DialOption
func LoggerDialOption ¶
func LoggerDialOption(logger logger.ILogger) DialOption
func SockOptsDialOption ¶
func SockOptsDialOption(so *SockOpts) DialOption
func TimeoutDialOption ¶
func TimeoutDialOption(d time.Duration) DialOption
type DialOptions ¶
type HTTPNodeSettings ¶
type HTTPNodeSettings struct { Host string Header map[string]string Auther auth.IAuthenticator Rewrite []HTTPURLRewriteSetting }
type HTTPURLRewriteSetting ¶ added in v0.0.2
type IChainer ¶
type IChainer interface {
Route(ctx context.Context, network, address string, opts ...RouteOption) IRoute
}
type IRoute ¶
type IRoute interface { Dial(ctx context.Context, network, address string, opts ...DialOption) (net.Conn, error) Bind(ctx context.Context, network, address string, opts ...BindOption) (net.Listener, error) Nodes() []*Node }
var (
DefaultRoute IRoute = &route{}
)
type Node ¶
func (*Node) Options ¶
func (node *Node) Options() *NodeOptions
type NodeOption ¶
type NodeOption func(*NodeOptions)
func BypassNodeOption ¶
func BypassNodeOption(bp bypass.IBypass) NodeOption
func HTTPNodeOption ¶
func HTTPNodeOption(httpSettings *HTTPNodeSettings) NodeOption
func HostMapperNodeOption ¶
func HostMapperNodeOption(m hosts.IHostMapper) NodeOption
func HostNodeOption ¶
func HostNodeOption(host string) NodeOption
func MetadataNodeOption ¶
func MetadataNodeOption(md metadata.IMetaData) NodeOption
func NetworkNodeOption ¶
func NetworkNodeOption(network string) NodeOption
func PathNodeOption ¶
func PathNodeOption(path string) NodeOption
func ProtocolNodeOption ¶
func ProtocolNodeOption(protocol string) NodeOption
func ResoloverNodeOption ¶
func ResoloverNodeOption(resolver resolver.IResolver) NodeOption
func TLSNodeOption ¶
func TLSNodeOption(tlsSettings *TLSNodeSettings) NodeOption
func TransportNodeOption ¶
func TransportNodeOption(tr *Transport) NodeOption
type NodeOptions ¶
type NodeOptions struct { Transport *Transport Bypass bypass.IBypass Resolver resolver.IResolver HostMapper hosts.IHostMapper Metadata metadata.IMetaData Host string Network string Protocol string Path string HTTP *HTTPNodeSettings TLS *TLSNodeSettings }
type RouteOption ¶
type RouteOption func(opts *RouteOptions)
func WithHostRouteOption ¶
func WithHostRouteOption(host string) RouteOption
type RouteOptions ¶
type RouteOptions struct {
Host string
}
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func NewRouter ¶
func NewRouter(opts ...RouterOption) *Router
func (*Router) Options ¶
func (r *Router) Options() *RouterOptions
type RouterOption ¶
type RouterOption func(*RouterOptions)
func ChainRouterOption ¶
func ChainRouterOption(chain IChainer) RouterOption
func HostMapperRouterOption ¶
func HostMapperRouterOption(m hosts.IHostMapper) RouterOption
func InterfaceRouterOption ¶
func InterfaceRouterOption(ifceName string) RouterOption
func LoggerRouterOption ¶
func LoggerRouterOption(logger logger.ILogger) RouterOption
func RecordersRouterOption ¶
func RecordersRouterOption(recorders ...recorder.RecorderObject) RouterOption
func ResolverRouterOption ¶
func ResolverRouterOption(resolver resolver.IResolver) RouterOption
func RetriesRouterOption ¶
func RetriesRouterOption(retries int) RouterOption
func SockOptsRouterOption ¶
func SockOptsRouterOption(so *SockOpts) RouterOption
func TimeoutRouterOption ¶
func TimeoutRouterOption(timeout time.Duration) RouterOption
type RouterOptions ¶
type TLSNodeSettings ¶
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func NewTransport ¶
func NewTransport(d dialer.IDialer, c connector.IConnector, opts ...TransportOption) *Transport
func (*Transport) Options ¶
func (tr *Transport) Options() *TransportOptions
type TransportOption ¶
type TransportOption func(*TransportOptions)
func AddrTransportOption ¶
func AddrTransportOption(addr string) TransportOption
func InterfaceTransportOption ¶
func InterfaceTransportOption(ifceName string) TransportOption
func RouteTransportOption ¶
func RouteTransportOption(route IRoute) TransportOption
func SockOptsTransportOption ¶
func SockOptsTransportOption(so *SockOpts) TransportOption
func TimeoutTransportOption ¶
func TimeoutTransportOption(timeout time.Duration) TransportOption
Click to show internal directories.
Click to hide internal directories.