MCPcopy
hub / github.com/crowdsecurity/crowdsec / Loadplugin

Function Loadplugin

pkg/parser/enrich.go:25–62  ·  view source on GitHub ↗

* mimic plugin loading */

()

Source from the content-addressed store, hash-verified

23
24/* mimic plugin loading */
25func Loadplugin() (EnricherCtx, error) {
26 enricherCtx := EnricherCtx{}
27 enricherCtx.Registered = make(map[string]*Enricher)
28
29 EnrichersList := []*Enricher{
30 {
31 Name: "GeoIpCity",
32 EnrichFunc: GeoIpCity,
33 },
34 {
35 Name: "GeoIpASN",
36 EnrichFunc: GeoIpASN,
37 },
38 {
39 Name: "IpToRange",
40 EnrichFunc: IpToRange,
41 },
42 {
43 Name: "reverse_dns",
44 EnrichFunc: reverse_dns,
45 },
46 {
47 Name: "ParseDate",
48 EnrichFunc: ParseDate,
49 },
50 {
51 Name: "UnmarshalJSON",
52 EnrichFunc: unmarshalJSON,
53 },
54 }
55
56 for _, enricher := range EnrichersList {
57 log.Infof("Successfully registered enricher '%s'", enricher.Name)
58 enricherCtx.Registered[enricher.Name] = enricher
59 }
60
61 return enricherCtx, nil
62}

Callers 2

LoadParsersFunction · 0.85
prepTestsFunction · 0.85

Calls

no outgoing calls

Tested by 1

prepTestsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…