-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebprofiler.go
More file actions
51 lines (42 loc) · 1.3 KB
/
webprofiler.go
File metadata and controls
51 lines (42 loc) · 1.3 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package webprofiler
import (
"context"
"net/http"
"github.com/GoFurry/web-profiler/internal/core"
"github.com/GoFurry/web-profiler/internal/model"
"github.com/GoFurry/web-profiler/internal/policy"
)
type (
SampleStrategy = policy.SampleStrategy
Config = policy.Config
BodyConfig = policy.BodyConfig
FingerprintConfig = policy.FingerprintConfig
ComplexityConfig = policy.ComplexityConfig
CharsetConfig = policy.CharsetConfig
Profile = model.Profile
MetaInfo = model.MetaInfo
EntropyResult = model.EntropyResult
FingerprintResult = model.FingerprintResult
ComplexityResult = model.ComplexityResult
ScoreFactor = model.ScoreFactor
FormatTextMetrics = model.FormatTextMetrics
CharsetResult = model.CharsetResult
Warning = model.Warning
)
const (
SampleStrategyHead = policy.SampleStrategyHead
SampleStrategyTail = policy.SampleStrategyTail
SampleStrategyHeadTail = policy.SampleStrategyHeadTail
)
func DefaultConfig() Config {
return policy.DefaultConfig()
}
func Middleware(cfg Config) func(http.Handler) http.Handler {
return core.Middleware(cfg)
}
func Wrap(next http.Handler, cfg Config) http.Handler {
return core.Wrap(next, cfg)
}
func FromContext(ctx context.Context) (*Profile, bool) {
return core.FromContext(ctx)
}