Documentation ¶
Overview ¶
Package maintner mirrors, searches, syncs, and serves Git, Github, and Gerrit metadata.
Maintner is short for "Maintainer". This package is intended for use by many tools. The name of the daemon that serves the maintner data to other tools is "maintnerd".
Index ¶
- type Corpus
- func (c *Corpus) AddGithub(owner, repo, tokenFile string)
- func (c *Corpus) AddGoGitRepo(goRepo, dir string)
- func (c *Corpus) Initialize(ctx context.Context, src MutationSource) error
- func (c *Corpus) Poll(ctx context.Context) error
- func (c *Corpus) PollGitCommits(ctx context.Context, conf polledGitCommits) error
- func (c *Corpus) PopulateFromAPIs(ctx context.Context) error
- func (c *Corpus) PopulateFromDisk(ctx context.Context, dir string) error
- func (c *Corpus) PopulateFromServer(ctx context.Context, serverURL string) error
- func (c *Corpus) QueryFrequentlyModifiedFiles(topN int) []FileCount
- func (c *Corpus) SetDebug()
- func (c *Corpus) StartLogging()
- type DiskMutationLogger
- type FileCount
- type MutationLogger
- type MutationSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Corpus ¶
type Corpus struct { MutationLogger MutationLogger Verbose bool // contains filtered or unexported fields }
Corpus holds all of a project's metadata.
There are two main phases to the Corpus: the catch-up phase, when the Corpus is populated from a MutationSource (disk, database), and the polling phase, when the Corpus polls for new events and stores/writes them to disk. Call StartLogging between the catch-up phase and the polling phase.
func NewCorpus ¶
func NewCorpus(logger MutationLogger) *Corpus
func (*Corpus) AddGoGitRepo ¶
AddGoGitRepo registers a git directory to have its metadata slurped into the corpus. The goRepo is a name like "go" or "net". The dir is a path on disk.
TODO(bradfitz): this whole interface is temporary. Make this support any git repo and make this (optionally?) use the gitmirror service later instead of a separate copy on disk.
func (*Corpus) Initialize ¶
func (c *Corpus) Initialize(ctx context.Context, src MutationSource) error
Initialize populates the Corpus using the data from the MutationSource.
func (*Corpus) PollGitCommits ¶
PollGitCommits polls for git commits in a directory.
func (*Corpus) PopulateFromAPIs ¶
PopulateFromAPIs populates the corpus using API calls to the upstream Git, Github, and/or Gerrit servers.
func (*Corpus) PopulateFromDisk ¶
PopulateFromDisk populates the corpus from a set of mutation logs in a local directory.
func (*Corpus) PopulateFromServer ¶
PopulateFromServer populates the corpus from a maintnerd server.
func (*Corpus) QueryFrequentlyModifiedFiles ¶
queryFrequentlyModifiedFiles is an example query just for fun. It is not currently used by anything.
func (*Corpus) StartLogging ¶
func (c *Corpus) StartLogging()
StartLogging indicates that further changes should be written to the log.
type DiskMutationLogger ¶
type DiskMutationLogger struct {
// contains filtered or unexported fields
}
DiskMutationLogger logs mutations to disk.
func NewDiskMutationLogger ¶
func NewDiskMutationLogger(directory string) *DiskMutationLogger
NewDiskMutationLogger creates a new DiskMutationLogger, which will create mutations in the given directory.
func (*DiskMutationLogger) GetMutations ¶
func (d *DiskMutationLogger) GetMutations(ctx context.Context) <-chan *maintpb.Mutation
type MutationLogger ¶
A MutationLogger logs mutations.
type MutationSource ¶
type MutationSource interface { // GetMutations returns a channel of mutations. // The channel should be closed at the end. // All sends on the returned channel should select // on the provided context. GetMutations(context.Context) <-chan *maintpb.Mutation }
A MutationSource yields a log of mutations that will catch a corpus back up to the present.
Directories ¶
Path | Synopsis |
---|---|
The maintnerd command serves project maintainer data from Git, Github, and/or Gerrit.
|
The maintnerd command serves project maintainer data from Git, Github, and/or Gerrit. |
Package maintpb is a generated protocol buffer package.
|
Package maintpb is a generated protocol buffer package. |