mirror of
https://github.com/safing/portbase
synced 2025-04-10 20:49:09 +00:00
38 lines
912 B
Go
38 lines
912 B
Go
package database
|
|
|
|
import (
|
|
"github.com/safing/portbase/database/record"
|
|
)
|
|
|
|
// HookBase implements the Hook interface and provides dummy functions to reduce boilerplate.
|
|
type HookBase struct{}
|
|
|
|
// UsesPreGet implements the Hook interface and returns false.
|
|
func (b *HookBase) UsesPreGet() bool {
|
|
return false
|
|
}
|
|
|
|
// UsesPostGet implements the Hook interface and returns false.
|
|
func (b *HookBase) UsesPostGet() bool {
|
|
return false
|
|
}
|
|
|
|
// UsesPrePut implements the Hook interface and returns false.
|
|
func (b *HookBase) UsesPrePut() bool {
|
|
return false
|
|
}
|
|
|
|
// PreGet implements the Hook interface.
|
|
func (b *HookBase) PreGet(dbKey string) error {
|
|
return nil
|
|
}
|
|
|
|
// PostGet implements the Hook interface.
|
|
func (b *HookBase) PostGet(r record.Record) (record.Record, error) {
|
|
return r, nil
|
|
}
|
|
|
|
// PrePut implements the Hook interface.
|
|
func (b *HookBase) PrePut(r record.Record) (record.Record, error) {
|
|
return r, nil
|
|
}
|