fragment.go 756 B

123456789101112131415161718192021222324
  1. package detect
  2. // Fragment contains the data to be scanned
  3. type Fragment struct {
  4. // Raw is the raw content of the fragment
  5. Raw string
  6. Bytes []byte
  7. // FilePath is the path to the file, if applicable.
  8. // The path separator MUST be normalized to `/`.
  9. FilePath string
  10. SymlinkFile string
  11. // WindowsFilePath is the path with the original separator.
  12. // This provides a backwards-compatible solution to https://github.com/gitleaks/gitleaks/issues/1565.
  13. WindowsFilePath string `json:"-"` // TODO: remove this in v9.
  14. // CommitSHA is the SHA of the commit if applicable
  15. CommitSHA string
  16. // newlineIndices is a list of indices of newlines in the raw content.
  17. // This is used to calculate the line location of a finding
  18. newlineIndices [][]int
  19. }