Documentation ¶
Overview ¶
Package provider contains types and interfaces for interacting with Git repos.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commit ¶
type Commit struct { CommitNumber types.CommitNumber `json:"offset"` GitHash string `json:"hash"` Timestamp int64 `json:"ts"` // Unix timestamp, seconds from the epoch. Author string `json:"author"` Subject string `json:"message"` URL string `json:"url"` Body string `json:"body"` // it's used to parse commit number, won't be insert into database. }
Commit represents a single commit stored in the database.
JSON annotations make it serialize like the legacy cid.CommitDetail.
type CommitProcessor ¶
CommitProcessor is a callback function that will be called with a Commit. Used in GitProvider.
type Provider ¶
type Provider interface { // CommitsFromMostRecentGitHashToHead will call the `cb` func with every // Commit, starting from the oldest and going to the newest. If // mostRecentGitHash is the empty string then the commits will start with // the very first commit to the repo, or from the start commit if one is // provided. CommitsFromMostRecentGitHashToHead(ctx context.Context, mostRecentGitHash string, cb CommitProcessor) error // GitHashesInRangeForFile returns all the git hashes when the given file // has changed between [begin, end], i.e. the given range is exclusive of // the begin commit and inclusive of the end commit. If 'begin' is the empty // string then the scan should go back to the initial commit of the repo. GitHashesInRangeForFile(ctx context.Context, begin, end, filename string) ([]string, error) // LogEntry returns the full log entry of a commit (minus the diff) as a string. LogEntry(ctx context.Context, gitHash string) (string, error) // Update does any necessary work, like a `git pull`, to ensure that the // GitProvider has the most recent commits available. Update(ctx context.Context) error }
Provider in abstraction of how we get information about a repo. This could be implemented by either Git or the Gitiles API.
Click to show internal directories.
Click to hide internal directories.