Documentation ¶
Index ¶
- func CleanOnError(err *error, path string)
- func CloneRepo(userInfo *url.Userinfo, gitUrl string) (clonePath string, repo *git.Repository, err error)
- func CloneRepoUsingToken(token, gitUrl, user string) (string, *git.Repository, error)
- func CloneRepoUsingUnauthenticated(url string) (string, *git.Repository, error)
- func GenerateLink(repo, commit, file string) string
- func GitCmdCheck() error
- func PrepareRepo(uriString string) (string, bool, error)
- func RepoFromPath(path string) (*git.Repository, error)
- func TryAdditionalBaseRefs(repo *git.Repository, base string) (*plumbing.Hash, error)
- type Git
- func (s *Git) ScanCommits(repo *git.Repository, path string, scanOptions *ScanOptions, ...) error
- func (s *Git) ScanRepo(_ context.Context, repo *git.Repository, repoPath string, ...) error
- func (s *Git) ScanUnstaged(repo *git.Repository, scanOptions *ScanOptions, chunksChan chan *sources.Chunk) error
- type ScanOption
- type ScanOptions
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanOnError ¶
func CloneRepoUsingToken ¶
CloneRepoUsingToken clones a repo using a provided token.
func CloneRepoUsingUnauthenticated ¶
CloneRepoUsingUnauthenticated clones a repo with no authentication required.
func GenerateLink ¶
GenerateLink crafts a link to the specific file from a commit. This works in most major git providers (Github/Gitlab)
func GitCmdCheck ¶
func GitCmdCheck() error
func PrepareRepo ¶
PrepareRepo clones a repo if possible and returns the cloned repo string.
func RepoFromPath ¶
Types ¶
type Git ¶
type Git struct {
// contains filtered or unexported fields
}
func (*Git) ScanCommits ¶
func (*Git) ScanUnstaged ¶
func (s *Git) ScanUnstaged(repo *git.Repository, scanOptions *ScanOptions, chunksChan chan *sources.Chunk) error
type ScanOption ¶
type ScanOption func(*ScanOptions)
func ScanOptionBaseHash ¶
func ScanOptionBaseHash(hash string) ScanOption
func ScanOptionFilter ¶
func ScanOptionFilter(filter *common.Filter) ScanOption
func ScanOptionHeadCommit ¶
func ScanOptionHeadCommit(hash string) ScanOption
func ScanOptionLogOptions ¶
func ScanOptionLogOptions(logOptions *git.LogOptions) ScanOption
func ScanOptionMaxDepth ¶
func ScanOptionMaxDepth(maxDepth int64) ScanOption
type ScanOptions ¶
type ScanOptions struct { Filter *common.Filter BaseHash string // When scanning a git.Log, this is the oldest/first commit. HeadHash string MaxDepth int64 LogOptions *git.LogOptions }
func NewScanOptions ¶
func NewScanOptions(options ...ScanOption) *ScanOptions
type Source ¶
func (*Source) Init ¶
func (s *Source) Init(aCtx context.Context, name string, jobId, sourceId int64, verify bool, connection *anypb.Any, concurrency int) error
Init returns an initialized GitHub source.
func (*Source) Type ¶
func (s *Source) Type() sourcespb.SourceType
Type returns the type of source. It is used for matching source types in configuration and job input.
Click to show internal directories.
Click to hide internal directories.