MCPcopy
hub / github.com/dreadl0ck/netcap / Encode

Method Encode

types/http.go:185–211  ·  view source on GitHub ↗

Encode will encode categorical values and normalize according to configuration

()

Source from the content-addressed store, hash-verified

183
184// Encode will encode categorical values and normalize according to configuration
185func (h *HTTP) Encode() []string {
186 return filter([]string{
187 httpEncoder.Int64(fieldTimestamp, h.Timestamp),
188 httpEncoder.String(fieldProto, h.Proto),
189 httpEncoder.String(fieldMethod, h.Method),
190 httpEncoder.String(fieldHost, h.Host),
191 httpEncoder.String(fieldUserAgent, h.UserAgent),
192 httpEncoder.String(fieldReferer, h.Referer),
193 // TODO: flatten
194 //join(reqCookies...),
195 //join(resCookies...),
196 httpEncoder.Int32(fieldReqContentLength, h.ReqContentLength),
197 httpEncoder.String(fieldURL, h.URL),
198 httpEncoder.Int32(fieldResContentLength, h.ResContentLength),
199 httpEncoder.String(fieldContentType, h.ContentType),
200 httpEncoder.Int32(fieldStatusCode, h.StatusCode),
201 httpEncoder.String(fieldSrcIP, h.SrcIP),
202 httpEncoder.String(fieldDstIP, h.DstIP),
203 httpEncoder.Int32(fieldSrcPort, h.SrcPort),
204 httpEncoder.Int32(fieldDstPort, h.DstPort),
205 httpEncoder.String(fieldReqContentEncoding, h.ReqContentEncoding),
206 httpEncoder.String(fieldResContentEncoding, h.ResContentEncoding),
207 httpEncoder.String(fieldServerName, h.ServerName),
208 httpEncoder.String(fieldFlow, h.Flow),
209 httpEncoder.String(fieldJa4h, h.Ja4H),
210 })
211}
212
213// Analyze will invoke the configured analyzer for the audit record and return a score.
214func (h *HTTP) Analyze() {}

Callers

nothing calls this directly

Calls 4

filterFunction · 0.85
Int64Method · 0.80
Int32Method · 0.80
StringMethod · 0.45

Tested by

no test coverage detected