collector

package
v0.0.0-...-e0a0d6c Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package collector provides structs for collecting stats about contributions to git base repositories.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewV3Client

func NewV3Client(constants config.Config) (client *github.Client, ctx context.Context)

NewV3Client returns an authenticated or anonymous GitHub v3 client

Example
c, _ := NewV3Client(config.Config{})
log.Println(c)
Output:

Types

type CollectReport

type CollectReport struct {
	Repos    []*RepoResults `json:"repos,omitempty"`
	Commits  int64          `json:"commits"`
	Lines    int64          `json:"lines"`
	Projects int64          `json:"projects"`
}

CollectReport contains the results of an entire collection of repos, and an aggregated value of each stats

type Collector

type Collector interface {
	// Collects stats from the API, and returns the values as a []byte of JSON content
	Collect() (stats *CollectReport, err error)
}

Collector is a simple interface for git repo collectors for that return stats.

type GitHubCloneCollector

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

GitHubCloneCollector uses offline caching of repos to obtain stats of contribution by members and domains of interest

func NewGitHubCloneCollector

func NewGitHubCloneCollector(contants config.Config, c cache.Cache) (ghc *GitHubCloneCollector)

NewGitHubCloneCollector returns a GitHubCloneCollector.

func (*GitHubCloneCollector) Collect

func (ghc *GitHubCloneCollector) Collect() (stats *CollectReport, err error)

Collect iterates over all members in the organization to aggregate their OpenSource contributions offline

type RepoResults

type RepoResults struct {
	Repo    string `json:"repo"`
	Commits int64  `json:"commits"`
	Lines   int64  `json:"lines"`
}

RepoResults contains results from an individual repository

Jump to

Keyboard shortcuts

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