filtering: refactor; change API; add "filters_update_interval" setting
+ config: "filters_update_interval" * add /control/filtering_info * remove /control/filtering/enable * remove /control/filtering/disable * add /control/filtering_config * remove /control/filtering/status * add /control/filtering/set_url * remove /control/filtering/enable_url * remove /control/filtering/disable_url
This commit is contained in:
@@ -10,14 +10,20 @@ import (
|
||||
|
||||
// QueryLog - main interface
|
||||
type QueryLog interface {
|
||||
// Close query log object
|
||||
Close()
|
||||
|
||||
// Set new configuration at runtime
|
||||
// Currently only 'Interval' field is supported.
|
||||
Configure(conf Config)
|
||||
|
||||
// Add a log entry
|
||||
Add(question *dns.Msg, answer *dns.Msg, result *dnsfilter.Result, elapsed time.Duration, addr net.Addr, upstream string)
|
||||
|
||||
// Get log entries
|
||||
GetData() []map[string]interface{}
|
||||
|
||||
// Clear memory buffer and remove log files
|
||||
Clear()
|
||||
}
|
||||
|
||||
@@ -27,7 +33,7 @@ type Config struct {
|
||||
Interval uint32 // interval to rotate logs (in hours)
|
||||
}
|
||||
|
||||
// New - create instance
|
||||
// New - create a new instance of the query log
|
||||
func New(conf Config) QueryLog {
|
||||
return newQueryLog(conf)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user