Documentation
¶
Overview ¶
Package gitiles is a client library for the Gitiles source viewer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blame ¶
type Blame struct {
Regions []BlameRegion
}
Blame represents all of the BlameRegions in a file.
type BlameRegion ¶
BlameRegion represents a attribution of a file range.
type Commit ¶
type Commit struct { Commit string Tree string Parents []string Author Person Committer Person Message string TreeDiff []DiffEntry `json:"tree_diff"` }
Commit describes a git commit.
type DiffEntry ¶
type DiffEntry struct { Type string OldID string `json:"old_id"` OldMode int `json:"old_mode"` OldPath string `json:"old_path"` NewID string `json:"new_id"` NewMode int `json:"new_mode"` NewPath string `json:"new_path"` }
DiffEntry describes a file difference.
type Options ¶
type Options struct { // A URL for the Gitiles service. Address string BurstQPS int SustainedQPS float64 // Path to a Netscape/Mozilla style cookie file. CookieJar string // UserAgent defines how we present ourself to the server. UserAgent string // HTTPClient allows callers to present their own http.Client instead of the default. HTTPClient http.Client Debug bool }
Options configures the the Gitiles service.
func DefineFlags ¶
func DefineFlags() *Options
DefineFlags sets up standard command line flags, and returns the options struct in which the values are put.
type Project ¶
type Project struct { Name string CloneURL string `json:"clone_url"` Description string `json:"description"` Branches map[string]string `json:"branches"` }
Project describes a repository
type RepoService ¶
type RepoService struct { Name string // contains filtered or unexported fields }
RepoService is a JSON client for the functionality of a specific respository.
func (*RepoService) Get ¶
func (s *RepoService) Get() (*Project, error)
Get retrieves a single project.
func (*RepoService) GetBlob ¶
func (s *RepoService) GetBlob(branch, filename string) ([]byte, error)
GetBlob fetches a blob.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a client for the Gitiles JSON interface.
func NewService ¶
NewService returns a new Gitiles JSON client.
func (*Service) NewRepoService ¶
func (s *Service) NewRepoService(name string) *RepoService
NewRepoService creates a service for a specific repository on a Gitiles server.