Documentation ¶
Index ¶
- type Context
- func (ctx *Context) Copy() *Context
- func (ctx *Context) CopyTo(d *Context) *Context
- func (ctx *Context) GetValue(k any) (any, bool)
- func (ctx *Context) HasMark(m uint32) bool
- func (ctx *Context) Id() uint32
- func (ctx *Context) InfoField() zap.Field
- func (ctx *Context) Q() *dns.Msg
- func (ctx *Context) R() *dns.Msg
- func (ctx *Context) SetKey(k, v any)
- func (ctx *Context) SetMark(m uint32)
- func (ctx *Context) SetResponse(r *dns.Msg)
- func (ctx *Context) StartTime() time.Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context is a query context that pass through plugins A Context will always have a non-nil Q. Context MUST be created using NewContext. All Context funcs are not safe for concurrent use.
func NewContext ¶
NewContext creates a new query Context. q is the query dns msg. It cannot be nil, or NewContext will panic. meta can be nil.
func (*Context) Id ¶
Id returns the Context id. Note: This id is not the dns msg id. It's a unique uint32 growing with the number of query.
func (*Context) SetKey ¶
SetKey stores any v in to this Context k should be an interface that has type but has a nil value.
func (*Context) SetResponse ¶
SetResponse stores the response r to the context. Note: It just stores the pointer of r. So the caller shouldn't modify or read r after the call.