listener

package
v0.0.0-...-26ed3c2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 8 Imported by: 32

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 AuthOption

func AuthOption(auth *url.Userinfo) Option

func AutherOption

func AutherOption(auther auth.Authenticator) Option

func ChainOption

func ChainOption(chain chain.Chainer) Option

func LoggerOption

func LoggerOption(logger logger.Logger) Option

func ProxyProtocolOption

func ProxyProtocolOption(ppv int) Option

func ServiceOption

func ServiceOption(service string) Option

func TLSConfigOption

func TLSConfigOption(tlsConfig *tls.Config) Option

type Options

type Options struct {
	Addr          string
	Auther        auth.Authenticator
	Auth          *url.Userinfo
	TLSConfig     *tls.Config
	Chain         chain.Chainer
	Logger        logger.Logger
	Service       string
	ProxyProtocol int
}

Jump to

Keyboard shortcuts

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