classifier

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Classification

type Classification struct {
	Masked    bool
	Protected bool
	// VarType is "env_var" or "file".
	VarType string
}

Classification holds the result of classifying a GitLab CI/CD variable.

type Classifier

type Classifier struct {
	// contains filtered or unexported fields
}

Classifier classifies variables using merged built-in and user rules.

func New

func New(userRules Rules) *Classifier

New creates a Classifier by merging built-in rules with user-provided rules. User rules are appended to built-in rules (both patterns and excludes). All patterns are pre-normalized to uppercase for case-insensitive matching.

func NewEmpty

func NewEmpty() *Classifier

NewEmpty creates a Classifier with no patterns at all (not even built-ins). Use this when auto-classification must be fully disabled.

func (*Classifier) Classify

func (c *Classifier) Classify(key, value, environment string) Classification

Classify determines the classification of a variable given its key, value, and deployment environment.

type Rules

type Rules struct {
	MaskedPatterns []string
	MaskedExclude  []string
	FilePatterns   []string
	FileExclude    []string
}

Rules holds user-supplied pattern overrides that are merged with built-in rules.

Jump to

Keyboard shortcuts

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