Documentation
¶
Index ¶
- Constants
- type Database
- type MongoDb
- func (m *MongoDb) FindHosts(hosts []string, hostdb string) []datatypes.QueryResult
- func (m *MongoDb) GetMetaData(hl hostlist.HostList, dbname string) (hostlist.MetaData, error)
- func (m *MongoDb) Init(host string, port int) error
- func (m *MongoDb) InsertHosts(c chan datatypes.BlacklistHost, hostdb string)
- func (m *MongoDb) RegisterHostList(hl hostlist.HostList, dbname string) error
- func (m *MongoDb) RemoveHostList(hl hostlist.HostList, dbname string)
Constants ¶
View Source
const HostTableName = "blacklistHosts"
View Source
const MetaTableName = "metadata"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database interface {
// Initialize database connection
Init(host string, port int) error
// Insert new hosts into the database. Hosts are passed in via a chanel,
// so this can be threaded with the function retrieving hosts from
// the blacklist source
InsertHosts(chan datatypes.BlacklistHost, string)
// Remove a blacklist source from the database.
RemoveHostList(hostlist.HostList, string)
// Check a list of hosts against the database.
FindHosts([]string, string) []datatypes.QueryResult
// Retrieve meta data for a specific blacklist source.
GetMetaData(hostlist.HostList, string) (hostlist.MetaData, error)
// Register a new blacklist source with the database.
RegisterHostList(hostlist.HostList, string) error
}
type MongoDb ¶
func (*MongoDb) FindHosts ¶
func (m *MongoDb) FindHosts(hosts []string, hostdb string) []datatypes.QueryResult
Query database for hosts. Return blacklist information
func (*MongoDb) GetMetaData ¶
Get metadata for a specific blacklist source
func (*MongoDb) InsertHosts ¶
func (m *MongoDb) InsertHosts(c chan datatypes.BlacklistHost, hostdb string)
Insert new hosts into the database. Hosts are passed in via a chanel, so this can be threaded with the function retrieving hosts from the blacklist source
func (*MongoDb) RegisterHostList ¶
Add a new source list to the metadata collection.
Click to show internal directories.
Click to hide internal directories.