cmd

package
v0.0.0-...-5f5066d Latest Latest
Warning

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

Go to latest
Published: May 1, 2018 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const AccessTokenDesc = "GitHub access token for authorized rate limits"

AccessTokenDesc describes usage.

View Source
const AdvancedReportingDesc = "Enable advanced long running reports: followers, cross-stars, commiters"

AdvancedReportingDesc describes AdvancedReporting usage

View Source
const CacheDirDesc = "directory for storing cached GitHub API responses"

CacheDirDesc describes usage.

View Source
const RepoDesc = "GitHub owner and repository, formatted as :owner/:repo"

RepoDesc describes usage.

View Source
const SpreadSheetIDDesc = "Google SpreadSheet id to update"

SpreadSheetIDDesc describes usage of folder-id.

Variables

View Source
var AccessToken string

AccessToken is used to access repo stars and gain non-authorized rate limits.

View Source
var AdvancedReporting bool

AdvancedReporting enabled reports for followers, cross-stars, commiters

View Source
var AnalyzeCmd = &cobra.Command{
	Use:   "analyze --repo=:owner/:repo",
	Short: "analyze previously fetched and saved GitHub stargazer data",
	Long: `

Analyzes the previously fetched and saved GitHub stargazer data. The
following analyses are run:

    - Cumulative stars (week timestamp and star count)
    - Correlated repos (count of occurrences of other starred & subscribed repos)
    - Correlation histogram (50 bins of occurrence counts)
    - Stargazer report (name, email(?), date starred, correlation score,
      correlated repos, raw activity, raw activity repos, correlated activity,
      correlated activity repos
`,
	Example: `  stargazers analyze --repo=cockroachdb/cockroach`,
	RunE:    RunAnalyze,
}

AnalyzeCmd analyzes previously fetched GitHub stargazer data.

View Source
var CacheDir string

CacheDir specifies where to store cached JSON responses.

View Source
var ClearCmd = &cobra.Command{
	Use:   "clear --repo=:owner/:repo",
	Short: "clear cached GitHub API responses",
	Long: `
Clears all GitHub API responses which have been cached in the repo-specific
--cache subdirectory.
`,
	Example: `  stargazers clear --repo=cockroachdb/cockroach`,
	RunE:    RunClear,
}

ClearCmd clears cached GitHub API responses.

View Source
var ExportCmd = &cobra.Command{
	Use:   "export --repo=:owner/:repo",
	Short: "export previously analyzed reports to Google Sheets",
	Long: `

Exports generated reports as a SpreadSheet, with each report done as sheet  
`,
	Example: `  stargazers export --repo=cockroachdb/cockroach`,
	RunE:    RunExportToSheets,
}

ExportCmd analyzes previously fetched GitHub stargazer data.

View Source
var FetchCmd = &cobra.Command{
	Use:   "fetch --repo=:owner/:repo --token=:access_token",
	Short: "recursively fetch all stargazer github data",
	Long: `
Recursively fetch all stargazer github data starting with the list of
stargazers for the specified :owner/:repo and then descending into
each stargazer's followers, other starred repos, and subscribed
repos. Each subscribed repo is further queried for that stargazer's
contributions in terms of additions, deletions, and commits. All
fetched data is cached by URL. 
`,
	Example: `  stargazers fetch --repo=cockroachdb/cockroach --token=f87456b1112dadb2d831a5792bf2ca9a6afca7bc`,
	RunE:    RunFetch,
}

FetchCmd recursively fetches stargazer github data.

View Source
var Repo string

Repo specifies the the owner and repository in :owner/:repo format.

View Source
var SpreadSheetID string

SpreadSheetID Google drive of folder to move file (optional)

Functions

func RunAnalyze

func RunAnalyze(cmd *cobra.Command, args []string) error

RunAnalyze fetches saved stargazer info for the specified repo and runs the analysis reports.

func RunClear

func RunClear(cmd *cobra.Command, args []string) error

RunClear clears all cached GitHub API responses for the specified repo.

func RunExportToSheets

func RunExportToSheets(cmd *cobra.Command, args []string) error

RunExportToSheets fetches saved stargazer info for the specified repo and runs the analysis reports.

func RunFetch

func RunFetch(cmd *cobra.Command, args []string) error

RunFetch recursively queries all relevant github data for the specified owner and repo.

Types

This section is empty.

Jump to

Keyboard shortcuts

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