Documentation ¶
Overview ¶
Package db prvoides a unified interface to add, modify, and delete newly obsereved domains from any database.
Index ¶
- type Entry
- type NodDB
- type PebbleDB
- func (db *PebbleDB) Add(entry Entry) error
- func (db *PebbleDB) AddMany(entries []Entry) error
- func (db *PebbleDB) Close() error
- func (db *PebbleDB) Delete(domain string) error
- func (db *PebbleDB) DeleteMany(domains []string) error
- func (db *PebbleDB) Open() error
- func (db *PebbleDB) Query(domain string) (Entry, error)
- func (db *PebbleDB) QueryMany(domains []string) ([]Entry, error)
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct { // Domain name Domain string `json:"domain"` // Date of first observation RegistrationDate time.Time `json:"registration_date"` }
Entry represents a single domain entry in the database
type NodDB ¶
type NodDB interface { // Open opens a connection to the database Open() error // Close closes the connection to the database Close() error // Add adds a new domain to the database Add(Entry) error // AddMany adds multiple new domains to the database AddMany([]Entry) error // Delete removes a domain from the database Delete(string) error // DeleteMany removes multiple domains from the database DeleteMany([]string) error // Query returns the date of first observation for a given domain Query(string) (Entry, error) // QueryMany returns the date of first observation for multiple domains QueryMany([]string) ([]Entry, error) }
NodDB is the interface that must be implemented by any database that is to be used
type PebbleDB ¶
PebbleDB is a wrapper around a Pebble database.
func NewPebbleDB ¶
NewPebbleDB creates a new PebbleDB instance. Note that the database is not opened until Open() is called.
func (*PebbleDB) DeleteMany ¶
DeleteMany deletes many entries from the database.
Click to show internal directories.
Click to hide internal directories.