Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultServerHandler ¶
type DefaultServerHandler struct {
// contains filtered or unexported fields
}
func NewDefaultServerHandler ¶
func NewDefaultServerHandler(config *DefaultServerHandlerConfig) *DefaultServerHandler
NewDefaultServerHandler Also see DefaultServerHandler.ServeDNS.
func (*DefaultServerHandler) ServeDNS ¶
func (h *DefaultServerHandler) ServeDNS(ctx context.Context, qCtx *handler.Context, w ResponseWriter)
ServeDNS If entry returns an err, a SERVFAIL response will be sent back to client. If concurrentLimit is reached, the query will block and wait available token until ctx is done.
type DefaultServerHandlerConfig ¶
type DefaultServerHandlerConfig struct { // Logger is used for logging, it cannot be nil. Logger *zap.Logger // Entry is the entry ExecutablePlugin's tag. This shouldn't be empty. Entry *executable_seq.ExecutableCmdSequence // ConcurrentLimit controls the max concurrent queries for the DefaultServerHandler. // If ConcurrentLimit <= 0, means no limit. // When calling DefaultServerHandler.ServeDNS(), if a query exceeds the limit, it will wait on a FIFO queue until // - its ctx is done -> The query will be dropped silently. // - it can be proceeded -> Normal procedure. ConcurrentLimit int }
type DummyServerHandler ¶
func (*DummyServerHandler) ServeDNS ¶
func (d *DummyServerHandler) ServeDNS(_ context.Context, qCtx *handler.Context, w ResponseWriter)
type ResponseWriter ¶
ResponseWriter can write msg to the client.
type ServerHandler ¶
type ServerHandler interface { // ServeDNS uses ctx to control deadline, exchanges qCtx, and writes response to w. ServeDNS(ctx context.Context, qCtx *handler.Context, w ResponseWriter) }
Click to show internal directories.
Click to hide internal directories.