listener

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClosed = errors.New("accpet on closed listener")
)

Functions

func NewAcceptError

func NewAcceptError(err error) error

Types

type AcceptError

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

func (*AcceptError) Error

func (e *AcceptError) Error() string

func (*AcceptError) Temporary

func (e *AcceptError) Temporary() bool

func (*AcceptError) Timeout

func (e *AcceptError) Timeout() bool

func (*AcceptError) Unwrap

func (e *AcceptError) Unwrap() error

type Listener

type Listener interface {
	Init(metadata.Metadata) error
	Accept() (net.Conn, error)
	Addr() net.Addr
	Close() error
}

Listener is a server listener, just like a net.Listener.

type Option

type Option func(opts *Options)

func AddrOption

func AddrOption(addr string) Option

func AdmissionOption

func AdmissionOption(admission admission.Admission) Option

func AuthOption

func AuthOption(auth *url.Userinfo) Option

func AutherOption

func AutherOption(auther auth.Authenticator) Option

func ConnLimiterOption

func ConnLimiterOption(limiter conn.ConnLimiter) Option

func LoggerOption

func LoggerOption(logger logger.Logger) Option

func NetnsOption

func NetnsOption(netns string) Option

func ProxyProtocolOption

func ProxyProtocolOption(ppv int) Option

func RouterOption

func RouterOption(router chain.Router) Option

func ServiceOption

func ServiceOption(service string) Option

func StatsOption

func StatsOption(stats *stats.Stats) Option

func TLSConfigOption

func TLSConfigOption(tlsConfig *tls.Config) Option

func TrafficLimiterOption

func TrafficLimiterOption(limiter traffic.TrafficLimiter) Option

type Options

type Options struct {
	Addr           string
	Auther         auth.Authenticator
	Auth           *url.Userinfo
	TLSConfig      *tls.Config
	Admission      admission.Admission
	TrafficLimiter traffic.TrafficLimiter
	ConnLimiter    conn.ConnLimiter
	Chain          chain.Chainer
	Stats          *stats.Stats
	Logger         logger.Logger
	Service        string
	ProxyProtocol  int
	Netns          string
	Router         chain.Router
}

Jump to

Keyboard shortcuts

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