Documentation
¶
Overview ¶
Key generation and related methods relevant to any storage backend.
Index ¶
Constants ¶
const ( MASK_56 uint64 = 0xffffffffffffff CHECKSUM_MASK uint64 = 127 << 56 )
Variables ¶
var ( ErrorDatabaseNotFound = errors.New("database not found") ErrorResourceNotFound = errors.New("resource not found in data store") )
Functions ¶
func Key ¶
func Key(url URLWithHostname) uint64
Produces a 63 bit uint contained in a uint64 (SQLite cannot accept uint64 with high bit set as a primary key) [Bit 63] Always 0 [Bits 62-56] A 7 bit checksum based on the domain name [Bits 55-0] A 56 bit hash of the URL (reduced from a 64 bit fnv1a hash)
Types ¶
type DatabaseOptions ¶
type Factory ¶
type Factory func() (URLDataStore, error)
type Maintainable ¶
This interface adds create/clear/maintain methods to the URLDataStore interface.
type Observable ¶ added in v0.6.5
This interface is to expose a method to supply data to healthchecks.
type URLDataStore ¶
This interface is the contract for storing and retrieving WebPage resources. It adds a Store() method to the fetch.URLFetcher interface.
type URLWithHostname ¶
net.URL and URLString both implement this interface, which is needed to generate a key for the URL.