Documentation ¶
Overview ¶
Package resolvcache implements a dnsutil.ResolvCache service interface.
Index ¶
- type Cache
- func (o *Cache) Clean()
- func (o *Cache) Cleaned() time.Time
- func (o *Cache) Dump(out io.Writer)
- func (o *Cache) Expires() time.Duration
- func (o *Cache) Flush()
- func (o *Cache) Flushed() time.Time
- func (o *Cache) Get(client, resolved net.IP, name string) (bool, time.Time)
- func (o *Cache) Set(ts time.Time, client net.IP, name string, resolved []net.IP) error
- func (o *Cache) Store() time.Time
- type Limits
- type Option
- type Service
- func (s *Service) Check(ctx context.Context, client, resolved net.IP, name string) (dnsutil.CacheResponse, error)
- func (s *Service) Collect(ctx context.Context, client net.IP, name string, resolved []net.IP, ...) error
- func (s *Service) Shutdown()
- func (s *Service) Start() error
- func (s *Service) Uptime(ctx context.Context) (time.Time, time.Duration, error)
- type TraceLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache implements a resolv cache in memory.
type Option ¶
type Option func(*options)
Option is used for component configuration.
func SetTraceLogger ¶
func SetTraceLogger(l TraceLogger) Option
SetTraceLogger option sets a collection and query logger.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements a dnsutil.ResolvCache service
func NewService ¶
NewService creates a new Service.
func (*Service) Check ¶
func (s *Service) Check(ctx context.Context, client, resolved net.IP, name string) (dnsutil.CacheResponse, error)
Check implements dnsutil.ResolvChecker.
type TraceLogger ¶
type TraceLogger interface { LogCollect(*peer.Peer, time.Time, net.IP, string, []net.IP, []string) error LogCheck(peer *peer.Peer, ts time.Time, client, resolved net.IP, name string, resp dnsutil.CacheResponse) error }
TraceLogger interface defines collection and query logger interface.
Click to show internal directories.
Click to hide internal directories.