Documentation ¶
Overview ¶
Package gitiles contains logic of interacting with Gitiles.
Index ¶
- Variables
- func GetChangeLogs(c context.Context, repoUrl string, startRevision string, endRevision string) ([]*model.ChangeLog, error)
- func GetChangeLogsForSingleRevision(c context.Context, repoURL string, revision string) (*model.ChangeLog, error)
- func GetParentCommit(c context.Context, repoURL string, childCommit string) (string, error)
- func GetRepoUrl(c context.Context, commit *buildbucketpb.GitilesCommit) string
- func MockedGitilesClientContext(c context.Context, data map[string]string) context.Context
- type Client
- type GitilesClient
- type MockedGitilesClient
Constants ¶
This section is empty.
Variables ¶
View Source
var MockedGitilesClientKey = "mocked gitiles client"
Functions ¶
func GetChangeLogs ¶
func GetChangeLogs(c context.Context, repoUrl string, startRevision string, endRevision string) ([]*model.ChangeLog, error)
GetChangeLogs gets a list of ChangeLogs in revision range by batch. The changelogs contain revisions in (startRevision, endRevision]
func GetChangeLogsForSingleRevision ¶
func GetChangeLogsForSingleRevision(c context.Context, repoURL string, revision string) (*model.ChangeLog, error)
GetChangeLogsForSingleRevision returns the change log for a single revision
func GetParentCommit ¶
GetParentCommit queries gitiles for the parent commit of a particular commit. Parent commit is the commit right before the child commit.
func GetRepoUrl ¶
func GetRepoUrl(c context.Context, commit *buildbucketpb.GitilesCommit) string
Types ¶
type Client ¶
type Client interface {
// contains filtered or unexported methods
}
We need the interface for testing purpose
type GitilesClient ¶
type GitilesClient struct{}
type MockedGitilesClient ¶
Click to show internal directories.
Click to hide internal directories.