cmd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Copyright © 2026 hossiy21

Index

Constants

This section is empty.

Variables

View Source
var CurrentVersion = "v0.1.0"

Functions

func CheckForUpdates

func CheckForUpdates(verbose bool)

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.

func RunFix

func RunFix(envFile, exampleFile string, dryRun bool) (int, error)

func ShannonEntropy

func ShannonEntropy(data string) float64

Types

type AuditReport

type AuditReport struct {
	Score        int
	ScanCritical int
	ScanHigh     int
	ScanMedium   int
	Missing      int
	Placeholder  int
	Empty        int
	Passed       int
	DiffCount    int
}

func RunAudit

func RunAudit(envFile, exampleFile string) (AuditReport, error)

type DiffResult

type DiffResult struct {
	Key      string
	Type     string
	OldValue string
	NewValue string
}

func RunDiff

func RunDiff(file1, file2 string) (int, []DiffResult, error)

type EnvVar

type EnvVar struct {
	Key      string
	Value    string
	Comment  string
	Required bool
	Category string
	Tags     map[string]string
	LineNum  int
	Ignored  bool
}

func ParseEnvWithMetadata

func ParseEnvWithMetadata(filename string) ([]EnvVar, error)

type ScanOutput

type ScanOutput struct {
	File    string       `json:"file"`
	Results []ScanResult `json:"results"`
	Summary ScanSummary  `json:"summary"`
}

type ScanResult

type ScanResult struct {
	Line   int    `json:"line"`
	Key    string `json:"key"`
	Value  string `json:"value"`
	Reason string `json:"reason"`
	Risk   string `json:"risk"`
}

func RunScan

func RunScan(filename string) ([]ScanResult, error)

type ScanSummary

type ScanSummary struct {
	Critical int `json:"critical"`
	High     int `json:"high"`
	Medium   int `json:"medium"`
	Total    int `json:"total"`
}

type ValidateOutput

type ValidateOutput struct {
	EnvFile     string             `json:"env_file"`
	ExampleFile string             `json:"example_file"`
	Results     []ValidationResult `json:"results"`
	Summary     ValidateSummary    `json:"summary"`
}

type ValidateSummary

type ValidateSummary struct {
	Passed      int `json:"passed"`
	Missing     int `json:"missing"`
	Empty       int `json:"empty"`
	Placeholder int `json:"placeholder"`
}

type ValidationResult

type ValidationResult struct {
	Key     string `json:"key"`
	Status  string `json:"status"`
	Message string `json:"message"`
}

func RunValidate

func RunValidate(envFile, exampleFile string) (int, int, int, int, []ValidationResult, error)

Jump to

Keyboard shortcuts

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