Documentation
¶
Overview ¶
Package git provides a Git repository scan source.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SafeDisplayURL ¶
SafeDisplayURL returns a credential-stripped form of raw that is safe to put in logs, output metadata, error messages, and the scan summary. Any user-info portion (the "user:password@" part of a URL) is removed so no secret is ever surfaced.
The returned value is the clean URL with no noisy suffix, so it can be stored verbatim in a metadata field. When the URL cannot be parsed, the credential between "://" and "@" is masked on a best-effort basis; non-URL targets (for example local paths) are returned unchanged.
Types ¶
type GitSource ¶
type GitSource struct {
// contains filtered or unexported fields
}
GitSource is a Git repository-based scan source.
func (*GitSource) Close ¶
Close cleans up temporary resources. For cloned repositories, it removes the temporary directory.
type Option ¶
type Option func(*GitSource)
Option configures a GitSource.
func WithBufferSize ¶
WithBufferSize sets the chunk channel buffer size.
func WithExcludePaths ¶
WithExcludePaths sets glob patterns for file paths to exclude from scanning. Patterns are matched against each file's path within the repository, mirroring filesystem.WithExcludePaths semantics.
func WithMaxFileSize ¶
WithMaxFileSize sets the maximum file size to scan.
func WithSinceCommit ¶
WithSinceCommit scans only changes from the specified commit to HEAD.