cmd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute runs the root command

func GroupTechsByCategory

func GroupTechsByCategory(allRules []types.Rule) map[string][]types.TechInfo

GroupTechsByCategory groups technologies by their categories

func LoadRulesAndCategories

func LoadRulesAndCategories() ([]types.Rule, map[string]types.CategoryDefinition)

LoadRulesAndCategories loads both rules and categories config

func Output

func Output(o Outputter, format string)

Output handles unified output for any Outputter

func OutputToFile

func OutputToFile(o Outputter, format string, outputFile string)

OutputToFile handles unified output for any Outputter with optional file output

func SortCategories

func SortCategories(categories []types.CategoryInfo)

SortCategories sorts categories by name

func SortTechs

func SortTechs(technologies []types.TechInfo)

SortTechs sorts technologies by tech name

Types

type CategoriesResult

type CategoriesResult struct {
	Categories []types.CategoryInfo `json:"categories"`
	Count      int                  `json:"count"`
}

CategoriesResult is the output for the categories command

func (*CategoriesResult) ToJSON

func (r *CategoriesResult) ToJSON() interface{}

func (*CategoriesResult) ToText

func (r *CategoriesResult) ToText(w io.Writer)

type ComponentsResult

type ComponentsResult struct {
	ComponentCategories    []string `json:"component_categories"`
	NonComponentCategories []string `json:"non_component_categories"`
}

ComponentsResult is the output for the components flag

func (*ComponentsResult) ToJSON

func (r *ComponentsResult) ToJSON() interface{}

func (*ComponentsResult) ToText

func (r *ComponentsResult) ToText(w io.Writer)

type LanguageInfo

type LanguageInfo struct {
	Name       string   `json:"name"`
	Type       string   `json:"type"`
	Extensions []string `json:"extensions"`
}

LanguageInfo holds information about a language from go-enry

type LanguagesResult

type LanguagesResult struct {
	Languages []LanguageInfo   `json:"languages"`
	Summary   LanguagesSummary `json:"summary"`
}

LanguagesResult is the output for the languages command

func (*LanguagesResult) ToJSON

func (r *LanguagesResult) ToJSON() interface{}

func (*LanguagesResult) ToText

func (r *LanguagesResult) ToText(w io.Writer)

type LanguagesSummary

type LanguagesSummary struct {
	Total  int            `json:"total"`
	ByType map[string]int `json:"by_type"`
}

LanguagesSummary holds summary statistics

type Outputter

type Outputter interface {
	// ToJSON returns the data structure for JSON/YAML marshaling
	ToJSON() interface{}
	// ToText writes human-readable text format
	ToText(w io.Writer)
}

Outputter interface for commands with structured output

type RuleOutput

type RuleOutput struct {
	Tech         string                 `json:"tech"`
	Name         string                 `json:"name"`
	Category     string                 `json:"category"`
	Files        []string               `json:"files,omitempty"`
	Extensions   []string               `json:"extensions,omitempty"`
	Content      []types.ContentRule    `json:"content,omitempty"`
	Dependencies []types.Dependency     `json:"dependencies,omitempty"`
	Properties   map[string]interface{} `json:"properties,omitempty"`
	Description  string                 `json:"description,omitempty"`
}

RuleOutput represents the output format for rule info

type RuleResult

type RuleResult struct {
	Rule *types.Rule
}

RuleResult wraps a rule for output

func (*RuleResult) ToJSON

func (r *RuleResult) ToJSON() interface{}

func (*RuleResult) ToText

func (r *RuleResult) ToText(w io.Writer)

type TechTaxonomyCategory

type TechTaxonomyCategory struct {
	Name         string           `json:"name"`
	Description  string           `json:"description"`
	IsComponent  bool             `json:"is_component"`
	Technologies []types.TechInfo `json:"technologies"`
}

TechTaxonomyCategory represents a category with its technologies

type TechTaxonomyResult

type TechTaxonomyResult struct {
	Categories []TechTaxonomyCategory `json:"categories"`
	Count      int                    `json:"count"`
}

TechTaxonomyResult is the output for the tech-taxonomy command

func (*TechTaxonomyResult) ToJSON

func (r *TechTaxonomyResult) ToJSON() interface{}

func (*TechTaxonomyResult) ToText

func (r *TechTaxonomyResult) ToText(w io.Writer)

func (*TechTaxonomyResult) ToYAML

func (r *TechTaxonomyResult) ToYAML() interface{}

type TechsResult

type TechsResult struct {
	Technologies []types.TechInfo `json:"technologies"`
}

TechsResult is the output for the techs command

func (*TechsResult) ToJSON

func (r *TechsResult) ToJSON() interface{}

func (*TechsResult) ToText

func (r *TechsResult) ToText(w io.Writer)

Jump to

Keyboard shortcuts

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