4
0

fragment.go 853 B

1234567891011121314151617181920212223242526
  1. package sources
  2. // Fragment represents a fragment of a source with its meta data
  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 // TODO: remove this in v9 and use CommitInfo instead
  16. // StartLine is the line number this fragment starts on
  17. StartLine int
  18. // CommitInfo captures additional information about the git commit if applicable
  19. CommitInfo *CommitInfo
  20. }