domain

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildExtMap

func BuildExtMap(customExts map[string][]string, includeDefaults bool) map[string]Domain

BuildExtMap creates an extension-to-domain map by merging defaults with custom config. customExts maps domain names (as in config, e.g. "backend", "mobile") to extension lists. Custom extensions override defaults (e.g. moving .py from Backend to "Data"). If includeDefaults is false, only custom extensions are used (no built-in mappings).

func MatchRepoPattern

func MatchRepoPattern(repoName string, patterns []string) bool

MatchRepoPattern checks if a repo name matches a glob pattern

Types

type Domain

type Domain string

Domain represents a scoring domain (BE, FE, Infra, Firmware, or custom)

const (
	Backend  Domain = "BE"
	Frontend Domain = "FE"
	Infra    Domain = "Infra"
	Firmware Domain = "FW"
	Unknown  Domain = "Unknown"
)

func DetectFromFiles

func DetectFromFiles(files []string, extMap map[string]Domain) Domain

DetectFromFiles determines the domain of a repo based on file extension distribution. If extMap is nil, uses the default extension mapping.

func NormalizeName

func NormalizeName(name string) Domain

NormalizeName maps well-known domain aliases to their canonical short form (e.g. "backend" → "BE", "frontend" → "FE") and Title-Cases custom names.

func SortDomains

func SortDomains(ds []Domain) []Domain

SortDomains returns domains in stable display order: built-in domains first (Backend, Frontend, Infra, Firmware), then custom alphabetically, then Unknown last.

Jump to

Keyboard shortcuts

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