gitiles

package
v0.0.0-...-cf55a68 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package gitiles contains logic of interacting with Gitiles.

Index

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

func GetParentCommit(c context.Context, repoURL string, childCommit string) (string, error)

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

func MockedGitilesClientContext

func MockedGitilesClientContext(c context.Context, data map[string]string) context.Context

Types

type Client

type Client interface {
	// contains filtered or unexported methods
}

We need the interface for testing purpose

func GetClient

func GetClient(c context.Context) Client

type GitilesClient

type GitilesClient struct{}

type MockedGitilesClient

type MockedGitilesClient struct {
	Data map[string]string // Data for MockedGitilesClient to return
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL