Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeferCacheStore ¶ added in v1.5.2
type DeferCacheStore struct {
// contains filtered or unexported fields
}
func NewDeferStore ¶ added in v1.5.2
func NewDeferStore(key string, backend DnsCache) *DeferCacheStore
type DnsCache ¶
type DnsCache interface { // Get retrieves v from DnsCache. The returned v is a deepcopy of the original msg // that stored in the cache. The TTLs of v has already been modified properly. // The only thing that call should modify is msg's id. Get(ctx context.Context, key string) (v *dns.Msg, err error) // Store stores the v into DnsCache. It stores the deepcopy of v. Store(ctx context.Context, key string, v *dns.Msg, ttl time.Duration) (err error) // Closer closes the cache backend. io.Closer }
DnsCache represents a DNS cache backend.
type MemCache ¶
type MemCache struct {
// contains filtered or unexported fields
}
MemCache is a simple cache that stores msgs in memory.
func NewMemCache ¶
NewMemCache returns a MemCache. If cleanerInterval <= 0, MemCache cleaner is disabled. If shardNum or maxSizePerShard <=0, NewMemCache will panic.
type RedisCache ¶ added in v1.5.2
type RedisCache struct {
// contains filtered or unexported fields
}
func NewRedisCache ¶
func NewRedisCache(url string) (*RedisCache, error)
func (*RedisCache) Close ¶ added in v1.5.2
func (r *RedisCache) Close() error
Close closes the redis client.
Click to show internal directories.
Click to hide internal directories.