request.go 864 B

1234567891011121314151617181920212223242526272829303132333435
  1. package data
  2. import (
  3. "time"
  4. )
  5. func (r *Request) ToRequestData() *RequestData {
  6. return &RequestData{
  7. Url: r.Url,
  8. Reverse: r.Reverse,
  9. IpSrc: r.IpSrc,
  10. IpDst: r.IpDst,
  11. PortSrc: r.PortSrc,
  12. PortDst: r.PortDst,
  13. TcpSeq: r.TcpSeq,
  14. CreatedAt: time.Unix(0, r.CreatedAt),
  15. XForwardedFor: r.XForwardedFor,
  16. XRealIP: r.XRealIP,
  17. Method: r.Method,
  18. Origin: r.Origin,
  19. Referer: r.Referer,
  20. UserAgent: r.UserAgent,
  21. Source: r.Source,
  22. Host: r.Host,
  23. Protocol: r.Protocol,
  24. Connection: r.Connection,
  25. XRequestedWith: r.XRequestedWith,
  26. AcceptEncoding: r.AcceptEncoding,
  27. AcceptLanguage: r.AcceptLanguage,
  28. Accept: r.Accept,
  29. Cookie: r.Cookie,
  30. Via: r.Via,
  31. Customer: r.Customer,
  32. }
  33. }