handler

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 14 Imported by: 142

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Forwarder

type Forwarder interface {
	Forward(hop.Hop)
}

type HandleOption

type HandleOption func(opts *HandleOptions)

func MetadataHandleOption

func MetadataHandleOption(md metadata.Metadata) HandleOption

type HandleOptions

type HandleOptions struct {
	Metadata metadata.Metadata
}

type Handler

type Handler interface {
	Init(metadata.Metadata) error
	Handle(context.Context, net.Conn, ...HandleOption) error
}

type Option

type Option func(opts *Options)

func AuthOption

func AuthOption(auth *url.Userinfo) Option

func AutherOption

func AutherOption(auther auth.Authenticator) Option

func BypassOption

func BypassOption(bypass bypass.Bypass) Option

func LoggerOption

func LoggerOption(logger logger.Logger) Option

func NetnsOption

func NetnsOption(netns string) Option

func ObserverOption

func ObserverOption(observer observer.Observer) Option

func RateLimiterOption

func RateLimiterOption(limiter rate.RateLimiter) Option

func RecordersOption added in v0.1.3

func RecordersOption(recorders ...recorder.RecorderObject) Option

func RouterOption

func RouterOption(router chain.Router) Option

func ServiceOption

func ServiceOption(service string) Option

func TLSConfigOption

func TLSConfigOption(tlsConfig *tls.Config) Option

func TrafficLimiterOption

func TrafficLimiterOption(limiter traffic.TrafficLimiter) Option

type Options

type Options struct {
	Bypass      bypass.Bypass
	Router      chain.Router
	Auth        *url.Userinfo
	Auther      auth.Authenticator
	RateLimiter rate.RateLimiter
	Limiter     traffic.TrafficLimiter
	TLSConfig   *tls.Config
	Logger      logger.Logger
	Observer    observer.Observer
	Recorders   []recorder.RecorderObject
	Service     string
	Netns       string
}

Jump to

Keyboard shortcuts

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