collector

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwesomeLists

type AwesomeLists struct {
	IsMentioned bool `json:"awesomelists_is_mentioned,omitempty"`
}

AwesomeLists is pretty printed for embedding in bigger structures

type CodecovStats

type CodecovStats struct {
	RepoURL  string  `json:"codecov_url"` // need flat value so can not use url.URL
	NumFiles uint    `json:"codecov_files"`
	NumLines uint    `json:"codecov_lines"`
	Coverage float64 `json:"codecov_coverage"`
}

CodecovStats is pretty printed for embedding in bigger structures

func NewCodecovStats

func NewCodecovStats(r *codecov.RepoStats) (*CodecovStats, error)

NewCodecovStats look struct

type Edge

type Edge struct {
	From string `json:"from"`
	To   string `json:"to"`
}

type FileStats

type FileStats struct {
	HasBenchmarks bool `json:"files_has_benchmarks"`
	HasTests      bool `json:"files_has_tests"`
}

FileStats is pretty printed for embedding in bigger structures

type GitStats

type GitStats struct {
	LastCommit          string `json:"git_last_commit,omitempty"`  // applying formatting to days
	DaysSinceLastCommit uint   `json:"git_last_commit_days_since"` // num full days
	NumContributors     uint   `json:"git_num_contributors"`
}

GitStats is pretty printed for embedding in bigger structures

func NewGitStats

func NewGitStats(r *gitstats.GitStats) *GitStats

NewGitStats look struct

type GoModuleGraphStatsCollector

type GoModuleGraphStatsCollector struct {
	ModuleCollector GoModuleStatsCollector
}

GoModuleGraphStatsCollector collects data about Go modules and their relationships

func (*GoModuleGraphStatsCollector) CollectStats

func (c *GoModuleGraphStatsCollector) CollectStats(gmod gomodgraph.Graph) (Graph, error)

CollectStats returns new Graph with collected data Keeps as much data as possible. Does no stop on errors, but keep track of them.

func (*GoModuleGraphStatsCollector) CollectStatsWrite

func (c *GoModuleGraphStatsCollector) CollectStatsWrite(gmod gomodgraph.Graph, w io.Writer)

CollectStatsWrite is version that serializes output as soon as it is computed

type GoModuleStatsCollector

type GoModuleStatsCollector struct {
	GitStorage          gitstats.GitCmdLocalClient
	URLResolver         basiccache.GoCachedResolver
	GitStatsFetcher     gitstats.GitStatsFetcher
	TestRunner          gotestrunner.GoCmdTestRunner
	CodecovClient       codecov.HTTPClient
	GoReportCardClient  goreportcard.GoReportCardHTTPClient
	FileScanner         gofilescanner.FileScanner
	AwesomeListsChecker awesomelists.AwesomeListsChecker
	GitHubSummarizer    github.GitHubSummarizer
}

GoModuleStatsCollector is collecting all the details about single Go module Does not fail if encounters errors, but still collects thoese errors.

func (GoModuleStatsCollector) CollectStats

func (c GoModuleStatsCollector) CollectStats(moduleName string) (ModuleStats, error)

CollectStats fetches all possible information about Go module

type GoReportCardStats

type GoReportCardStats struct {
	Average   json.Number            `json:"goreportcard_average"`
	Grade     goreportcard.GradeEnum `json:"goreportcard_grade"`
	NumFiles  uint                   `json:"goreportcard_files"`
	NumIssues uint                   `json:"goreportcard_issues"`
}

GoReportCardStats is pretty printed for embedding in bigger structures

func NewGoReportCardStats

func NewGoReportCardStats(r *goreportcard.Report) *GoReportCardStats

NewGoReportCardStats look struct

type GoTestStats

type GoTestStats struct {
	HasTests               bool    `json:"gotest_has_tests"`
	AllTestsPassed         bool    `json:"gotest_all_tests_passed"`
	NumPackages            uint    `json:"gotest_num_packages"`
	NumPackagesWithTests   uint    `json:"gotest_num_packages_with_tests"`
	NumPackagesTestsPassed uint    `json:"gotest_num_packages_tests_passed"`
	AvgPackageCoverage     float64 `json:"gotest_package_coverage_avg"`
}

GoTestStats is pretty printed for embedding in bigger structures

func NewGoTestStats

NewGoTestStats look struct

type Graph

type Graph struct {
	Modules []ModuleStats
	Edges   []Edge
}

func (*Graph) WriteJSONL

func (g *Graph) WriteJSONL(w io.Writer) error

WriteJSONL which is default export format

type ModuleStats

type ModuleStats struct {
	ID         string `json:"id"` // unique key among all nodes, for Go this is module name
	ModuleName string `json:"-"`  // this is in id anyways

	CanGetGitStats bool `json:"can_get_git"`
	CanRunTests    bool `json:"can_run_tests"`
	CanGetGitHub   bool `json:"can_get_github"`

	GitHubURL string `json:"github_url,omitempty"`
	GitURL    string `json:"git_url,omitempty"`

	*GitStats             `json:",omitempty"`
	*CodecovStats         `json:",omitempty"`
	*GoTestStats          `json:",omitempty"`
	*GoReportCardStats    `json:",omitempty"`
	*FileStats            `json:",omitempty"`
	*ReadmeStats          `json:",omitempty"`
	*AwesomeLists         `json:",omitempty"`
	*github.GitHubSummary `json:",omitempty"`
}

ModuleStats is stats about single module

type ReadmeStats

type ReadmeStats struct {
	IsDeprecated bool `json:"readme_deprecated,omitempty"`
}

ReadmeStats is pretty printed for embedding in bigger structures

Jump to

Keyboard shortcuts

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