cmd

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Copyright © 2024 Alexey Tereshenkov

Copyright © 2025 Alexey Tereshenkov

Index

Constants

View Source
const (
	MetricDependenciesDirect            = "deps-direct"
	MetricDependenciesTransitive        = "deps-transitive"
	MetricReverseDependenciesDirect     = "rdeps-direct"
	MetricReverseDependenciesTransitive = "rdeps-transitive"
	MetricConnectedComponentsCount      = "components-count"
)
View Source
const (
	TechniqueTransitiveReduction = "transitive-reduction"
)

Variables

View Source
var DefaultReadFile = func(filePath string) ([]byte, error) {
	jsonData, readingFileError := os.ReadFile(filePath)
	if readingFileError != nil {
		return nil, readingFileError
	}
	return jsonData, nil
}
View Source
var Dependencies = dependencies

to be used in non-unit tests

View Source
var Dependents = dependents

to be used in non-unit tests

View Source
var ExtractSubgraph = extractSubgraph

to be used in non-unit tests

View Source
var Leaves = leaves

to be used in non-unit tests

View Source
var ListConnectedComponents = listConnectedComponents

to be used in non-unit tests

View Source
var Metrics = metrics

to be used in non-unit tests

View Source
var Paths = paths

to be used in non-unit tests

View Source
var RootCmd = &cobra.Command{
	Use:   "dg-query",
	Short: "A command-line utility program to query dependency graph of a codebase.",
	Long: `A command-line utility program to query dependency graph of a codebase
which operates on the adjacency list data stored as a JSON file. 

Git revision: ` + Version,
}

RootCmd represents the base command when called without any subcommands. This needs to be exported to be available to `main.go`.

View Source
var Roots = roots

to be used in non-unit tests

View Source
var SimplifyAdjacencyList = simplifyAdjacencyList

to be used in non-unit tests

View Source
var Version = "(redacted)"

This variable is going to be set by Bazel during stamping a Go binary; https://github.com/bazel-contrib/rules_go/blob/master/docs/go/core/defines_and_stamping.md

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the RootCmd.

Types

type AdjacencyList added in v0.2.0

type AdjacencyList map[string][]string

type GenericMapStringToAny added in v0.3.0

type GenericMapStringToAny map[string]interface{}

type ReadFileFunc added in v0.2.0

type ReadFileFunc func(filePath string) ([]byte, error)

Function type to be used for reading files

Jump to

Keyboard shortcuts

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