package quicreuse

import (
	
	
	

	
	
)

type Option func(*ConnManager) error

type listenUDP func(network string, laddr *net.UDPAddr) (net.PacketConn, error)

func ( listenUDP) Option {
	return func( *ConnManager) error {
		.listenUDP = 
		return nil
	}
}

func ( func() (SourceIPSelector, error)) Option {
	return func( *ConnManager) error {
		.sourceIPSelectorFn = 
		return nil
	}
}

func () Option {
	return func( *ConnManager) error {
		.enableReuseport = false
		return nil
	}
}

// ConnContext sets the context for all connections accepted by listeners. This doesn't affect the
// context for dialed connections. To reject a connection, return a non nil error.
func ( func( context.Context,  *quic.ClientInfo) (context.Context, error)) Option {
	return func( *ConnManager) error {
		if .connContext != nil {
			return errors.New("cannot set ConnContext more than once")
		}
		.connContext = 
		return nil
	}
}

// VerifySourceAddress returns whether to verify the source address for incoming connection requests.
// For more details see: `quic.Transport.VerifySourceAddress`
func ( func( net.Addr) bool) Option {
	return func( *ConnManager) error {
		.verifySourceAddress = 
		return nil
	}
}

// EnableMetrics enables Prometheus metrics collection. If reg is nil,
// prometheus.DefaultRegisterer will be used as the registerer.
func ( prometheus.Registerer) Option {
	return func( *ConnManager) error {
		.enableMetrics = true
		if  != nil {
			.registerer = 
		}
		return nil
	}
}