Documentation
¶
Index ¶
- type DB
- type Postgres
- func (db *Postgres) Close() error
- func (db *Postgres) CreateTable() (err error)
- func (db *Postgres) DropTable() (err error)
- func (db *Postgres) GetMaxIP() (maxIP uint32, err error)
- func (db *Postgres) GetOldestIP() (oldestIP uint32, err error)
- func (db *Postgres) Open() (err error)
- func (db *Postgres) Ping() error
- func (db *Postgres) Save(results types.Tasks) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { Open() error Ping() error CreateTable() error GetMaxIP() (uint32, error) GetOldestIP() (uint32, error) Save(types.Tasks) error Close() error }
DB implements interface for database (Postgres initially)
type Postgres ¶
type Postgres struct {
DBAddr, DBPort, DBName, DBUsername, DBPassword, DBTable string
// contains filtered or unexported fields
}
Postgres contains connection to Postgres
func (*Postgres) CreateTable ¶
CreateTable creates table if not exists
func (*Postgres) GetOldestIP ¶
GetOldestIP returns oldest IP from db
Click to show internal directories.
Click to hide internal directories.