gitiles

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UseGitilesClientFactory

func UseGitilesClientFactory(ctx context.Context, factory GitilesClientFactory) context.Context

UseGitilesClientFactory returns a context that causes new Client instances to use the given factory when getting gitiles clients.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides the gitiles-oriented operations required for bootstrapping.

func NewClient

func NewClient(ctx context.Context) *Client

NewClient returns a new gitiles client.

If ctx is a context returned from UseGitilesClientFactory, then the returned client will use the factory that was passed to UseGitilesClientFactory when creating gitiles clients. Otherwise, a factory that creates gitiles clients using gitiles.NewRESTClient and http.DefaultClient will be used.

func (*Client) DownloadFile

func (c *Client) DownloadFile(ctx context.Context, host, project, revision, path string) (string, error)

DownloadFile returns the contents of the file at the given path at the given revision of the given project on the given host.

func (*Client) FetchLatestRevision

func (c *Client) FetchLatestRevision(ctx context.Context, host, project, ref string) (string, error)

FetchLatestRevision returns the git commit hash for the latest change to the given ref of the given project on the given host.

type GitilesClient

GitilesClient provides a subset of the generated gitiles RPC client.

type GitilesClientFactory

type GitilesClientFactory func(ctx context.Context, host string) (GitilesClient, error)

GitilesClientFactory creates clients for accessing each necessary gitiles instance.

Jump to

Keyboard shortcuts

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