revdb

package
v0.0.0-...-23a4ccf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImportBroDNSEntries

func ImportBroDNSEntries(writer DBIface) int

ImportBroDNSEntries imports domain information from DNS entries in elastic search

func ImportBroSSLEntries

func ImportBroSSLEntries(writer DBIface) int

ImportBroSSLEntries imports ssl domain information from elastic search to db

Types

type BoltDB

type BoltDB struct {
	// contains filtered or unexported fields
}

BoltDB Handler for boltdb backend

func NewBoltDB

func NewBoltDB(path string, file string, name string) *BoltDB

NewBoltDB Creates new boltdb

func NewDefaultBoltDB

func NewDefaultBoltDB() *BoltDB

NewDefaultBoltDB returns boltdb with default values

func (*BoltDB) Close

func (b *BoltDB) Close()

Close closes boltdb

func (*BoltDB) IncDNSEntries

func (b *BoltDB) IncDNSEntries(numEntries int)

IncDNSEntries tracks dns entry addtions

func (*BoltDB) IncSSLEntries

func (b *BoltDB) IncSSLEntries(numEntries int)

IncSSLEntries tracks ssl entry additions

func (*BoltDB) ReadDB

func (b *BoltDB) ReadDB(ip string) (DnsVal, error)

ReadDB reads ip information from boltdb

func (*BoltDB) String

func (b *BoltDB) String() string

func (*BoltDB) WriteDB

func (b *BoltDB) WriteDB(ip string, domains []string) (int, error)

WriteDB writes ip/domain information to boltdb

type DBIface

type DBIface interface {
	DBWriter
	DBReader

	Close()
	String() string
	// contains filtered or unexported methods
}

DBIface Interface for revdb operations

type DBReader

type DBReader interface {
	ReadDB(ip string) (DnsVal, error)
}

DBReader Reader interface for revdb

type DBWriter

type DBWriter interface {
	WriteDB(ip string, domains []string) (int, error)
}

DBWriter Writer interface for revdb

type DnsInfo

type DnsInfo struct {
	WlId  int    `json:wlid`
	Whois string `json:whois`
}

type DnsVal

type DnsVal struct {
	IpInfo
	Domains map[string]DnsInfo
}

func NewDnsVal

func NewDnsVal() *DnsVal

type EsDB

type EsDB struct {
	// contains filtered or unexported fields
}

EsDB - Elastic search handler

func NewEsDBWriter

func NewEsDBWriter() *EsDB

NewEsDBWriter returns handle to elastic search (reader and writer)

func (*EsDB) ReadDB

func (dns *EsDB) ReadDB(ip string) (int, error)

ReadDB gets information from ES

func (*EsDB) WriteDB

func (dns *EsDB) WriteDB(ip string, domains []string) (int, error)

WriteDB writes to ES

type Handler

type Handler struct {
	Reader DBIface
	Writer DBIface
}

func NewDBHandler

func NewDBHandler(in DBIface,
	out DBIface) *Handler

func (*Handler) Close

func (db *Handler) Close()

func (*Handler) String

func (db *Handler) String() string

type IpInfo

type IpInfo struct {
	Black    bool `json:black`
	Attacker bool `json:attacker`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL