-
Notifications
You must be signed in to change notification settings - Fork 2
/
kcd.go
30 lines (25 loc) · 845 Bytes
/
kcd.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package kcd
import (
"github.com/expectedsh/kcd/pkg/extractor"
"github.com/expectedsh/kcd/pkg/hook"
)
// Configuration is the main configuration type of kcd
type Configuration struct {
StringsExtractors []extractor.Strings
ValueExtractors []extractor.Value
ErrorHook hook.ErrorHook
BindHook hook.BindHook
ValidateHook hook.ValidateHook
RenderHook hook.RenderHook
}
// Config is the instance of Configuration type.
// You can add as many extractor you want, modify them ...
// You can set your custom hook too.
var Config = Configuration{
StringsExtractors: []extractor.Strings{extractor.Path{}, extractor.Header{}, extractor.Query{}},
ValueExtractors: []extractor.Value{extractor.Context{}},
ErrorHook: hook.Error,
RenderHook: hook.Render,
BindHook: hook.Bind(256 * 1024),
ValidateHook: hook.Validate,
}