Documentation ¶
Index ¶
- Constants
- Variables
- type DatabaseHandler
- func (d *DatabaseHandler) AddEntry(lease controller.Lease) error
- func (d *DatabaseHandler) All() ([]controller.Lease, error)
- func (d *DatabaseHandler) AllActive(duration int) ([]controller.Lease, error)
- func (d *DatabaseHandler) AllBlockSubnets() ([]controller.Lease, error)
- func (d *DatabaseHandler) AllSingleIPSubnets() ([]controller.Lease, error)
- func (d *DatabaseHandler) CheckDatabase() error
- func (d *DatabaseHandler) DeleteEntry(underlayIP string) error
- func (d *DatabaseHandler) LastRenewedAtForUnderlayIP(underlayIP string) (int64, error)
- func (d *DatabaseHandler) LeaseForUnderlayIP(underlayIP string) (*controller.Lease, error)
- func (d *DatabaseHandler) Migrate() (int, error)
- func (d *DatabaseHandler) OldestExpiredBlockSubnet(expirationTime int) (*controller.Lease, error)
- func (d *DatabaseHandler) OldestExpiredSingleIP(expirationTime int) (*controller.Lease, error)
- func (d *DatabaseHandler) RenewLeaseForUnderlayIP(underlayIP string) error
- type Db
- type MigrateAdapter
- type Migrator
Constants ¶
View Source
const MySQL = "mysql"
View Source
const Postgres = "postgres"
Variables ¶
View Source
var RecordNotAffectedError = errors.New("record not affected")
Functions ¶
This section is empty.
Types ¶
type DatabaseHandler ¶
type DatabaseHandler struct {
// contains filtered or unexported fields
}
func NewDatabaseHandler ¶
func NewDatabaseHandler(migrator migrateAdapter, db Db) *DatabaseHandler
func (*DatabaseHandler) AddEntry ¶
func (d *DatabaseHandler) AddEntry(lease controller.Lease) error
func (*DatabaseHandler) All ¶
func (d *DatabaseHandler) All() ([]controller.Lease, error)
func (*DatabaseHandler) AllActive ¶
func (d *DatabaseHandler) AllActive(duration int) ([]controller.Lease, error)
func (*DatabaseHandler) AllBlockSubnets ¶
func (d *DatabaseHandler) AllBlockSubnets() ([]controller.Lease, error)
func (*DatabaseHandler) AllSingleIPSubnets ¶
func (d *DatabaseHandler) AllSingleIPSubnets() ([]controller.Lease, error)
func (*DatabaseHandler) CheckDatabase ¶
func (d *DatabaseHandler) CheckDatabase() error
func (*DatabaseHandler) DeleteEntry ¶
func (d *DatabaseHandler) DeleteEntry(underlayIP string) error
func (*DatabaseHandler) LastRenewedAtForUnderlayIP ¶
func (d *DatabaseHandler) LastRenewedAtForUnderlayIP(underlayIP string) (int64, error)
func (*DatabaseHandler) LeaseForUnderlayIP ¶
func (d *DatabaseHandler) LeaseForUnderlayIP(underlayIP string) (*controller.Lease, error)
func (*DatabaseHandler) Migrate ¶
func (d *DatabaseHandler) Migrate() (int, error)
func (*DatabaseHandler) OldestExpiredBlockSubnet ¶
func (d *DatabaseHandler) OldestExpiredBlockSubnet(expirationTime int) (*controller.Lease, error)
func (*DatabaseHandler) OldestExpiredSingleIP ¶
func (d *DatabaseHandler) OldestExpiredSingleIP(expirationTime int) (*controller.Lease, error)
func (*DatabaseHandler) RenewLeaseForUnderlayIP ¶
func (d *DatabaseHandler) RenewLeaseForUnderlayIP(underlayIP string) error
type MigrateAdapter ¶
type MigrateAdapter struct { }
func (*MigrateAdapter) Exec ¶
func (ma *MigrateAdapter) Exec(db Db, dialect string, m migrate.MigrationSource, dir migrate.MigrationDirection) (int, error)
Click to show internal directories.
Click to hide internal directories.