Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnswerCache ¶
type AnswerCache struct { Name string `json:"name"` Response *dns.Msg `json:"response"` Type dns.Type `json:"type"` Do bool `json:"do"` TimeToDie int64 `json:"time_to_die"` By string `json:"by"` Error bool }
func (*AnswerCache) MarshalJSON ¶
func (a *AnswerCache) MarshalJSON() ([]byte, error)
func (*AnswerCache) UnmarshalJSON ¶
func (a *AnswerCache) UnmarshalJSON(data []byte) error
type CacheRepository ¶
type CacheRepository struct {
// contains filtered or unexported fields
}
func NewCacheRepository ¶
func NewCacheRepository(size int) (*CacheRepository, error)
func (*CacheRepository) Get ¶
func (c *CacheRepository) Get(now int64, r *request.Request) (*AnswerCache, bool)
func (*CacheRepository) Set ¶
func (c *CacheRepository) Set(msg *AnswerCache) error
type ResponseWriter ¶
type ResponseWriter struct { dns.ResponseWriter // contains filtered or unexported fields }
func NewResponsePrinter ¶
func NewResponsePrinter(w dns.ResponseWriter, log clog.P, d *Dcache, state request.Request) *ResponseWriter
NewResponsePrinter returns ResponseWriter.
func (*ResponseWriter) RemoteAddr ¶
func (r *ResponseWriter) RemoteAddr() net.Addr
RemoteAddr implements the dns.ResponseWriter interface.
Click to show internal directories.
Click to hide internal directories.