Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { // Get retrieves v from Backend. The returned v may be the original value. The caller should // not modify it. Get(key string) (v []byte, storedTime, expirationTime time.Time) // Store stores a copy of v into Backend. v cannot be nil. // If expirationTime is already passed, Store is a noop. Store(key string, v []byte, storedTime, expirationTime time.Time) Len() int // Closer closes the cache backend. Get and Store should become noop calls. io.Closer }
Backend represents a cache backend. The Backend does not raise errors cause a cache error is not a fatal error to a dns query. The caller usually does not care too much about the cache error. Implements should handle errors themselves. Cache Backend is expected to be very fast. All operations should be done (or returned) in a short time. e.g. 50 ms.
Click to show internal directories.
Click to hide internal directories.