mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 17:28:31 +02:00
improved deserialization method
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package accesslog
|
||||
|
||||
import "github.com/yusing/go-proxy/internal/utils"
|
||||
|
||||
type (
|
||||
Format string
|
||||
Filters struct {
|
||||
@@ -30,18 +32,24 @@ var (
|
||||
|
||||
const DefaultBufferSize = 100
|
||||
|
||||
var DefaultConfig = Config{
|
||||
BufferSize: DefaultBufferSize,
|
||||
Format: FormatCombined,
|
||||
Fields: Fields{
|
||||
Headers: FieldConfig{
|
||||
DefaultMode: FieldModeDrop,
|
||||
func DefaultConfig() *Config {
|
||||
return &Config{
|
||||
BufferSize: DefaultBufferSize,
|
||||
Format: FormatCombined,
|
||||
Fields: Fields{
|
||||
Headers: FieldConfig{
|
||||
DefaultMode: FieldModeDrop,
|
||||
},
|
||||
Query: FieldConfig{
|
||||
DefaultMode: FieldModeKeep,
|
||||
},
|
||||
Cookies: FieldConfig{
|
||||
DefaultMode: FieldModeDrop,
|
||||
},
|
||||
},
|
||||
Query: FieldConfig{
|
||||
DefaultMode: FieldModeKeep,
|
||||
},
|
||||
Cookies: FieldConfig{
|
||||
DefaultMode: FieldModeDrop,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
utils.RegisterDefaultValueFactory(DefaultConfig)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user