explain

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package explain says what each finding means to someone who is not reading code, and what to do about it. Every view of a scan uses the same words, so a finding reads the same everywhere. Only words: what is a finding is decided by the rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyLabel

func KeyLabel(labels map[string]string, shared map[string]bool, key string) string

KeyLabel is the label of the stack stack:<tool>:<name>, with the tool added when another tool's stack has the same name: "chart (helm)".

func Rank

func Rank(l Level) int

Rank orders levels: act 0, confirm 1, info 2.

func SharedNames

func SharedNames(s *fact.Scan) map[string]bool

SharedNames are the stack names that stacks of more than one tool use (a helm and a kubernetes stack both called chart): only the tool tells them apart.

func StackLabels

func StackLabels(s *fact.Scan, m *rules.Map) map[string]string

StackLabels gives each stack of a scan a label a reader can place, by the stack's name. Display only: the stack's name stays in fact keys, stored scans and drift; only the words on screen and in the report change. In order:

  1. the name declared in .cernly.yml (stacks.<name>.name);
  2. the stack's own name, unless compose made it up (default, default-2);
  3. the folder of its first compose file (docker/development);
  4. the workflow that starts it (started by deploy.yml);
  5. its first compose file (docker-compose.yml).

Two stacks that would read the same get their compose file instead, and still the same, their name added. Deterministic: scan and map only.

func StackRole

func StackRole(stacks ...string) string

StackRole is the .cernly.yml that declares the stacks' roles, with the version line a new file needs: how a person settles production_unconfirmed in the repository. A stack is its name in the scan (the key's last part), never a display label.

Types

type Level

type Level string

Level orders findings for a reader: act first, then confirm, then info.

const (
	Act     Level = "act"     // something to change
	Confirm Level = "confirm" // a person checks it and confirms it, or declares it in .cernly.yml
	Info    Level = "info"    // worth knowing, nothing to do
)

type Rule

type Rule struct {
	ID      string `json:"id"`
	Title   string `json:"title"`
	Meaning string `json:"meaning"`
	Action  string `json:"action"`
	Level   Level  `json:"level"`
}

func All

func All() []Rule

All returns every rule of one scan or two, in a fixed order: the map's, then the gate's.

func GateRules

func GateRules() []Rule

GateRules returns the gate's findings, in a fixed order.

func MapRules

func MapRules() []Rule

MapRules returns the map's findings, in a fixed order.

func Of

func Of(id string) Rule

Of returns a rule's words; an unknown rule reads as its id.

Jump to

Keyboard shortcuts

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