types

package
v1.129.3 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GVKDoc

type GVKDoc struct {
	Kind       string      `yaml:"kind" json:"kind" validate:"required"`
	APIVersion string      `yaml:"apiVersion" json:"apiVersion"`
	Metadata   GVKMetadata `yaml:"metadata" json:"metadata"`
}

GVKDoc represents a Kubernetes resource with basic GVK info

type GVKMetadata

type GVKMetadata struct {
	Name      string `yaml:"name" json:"name"`
	Namespace string `yaml:"namespace" json:"namespace"`
}

GVKMetadata represents basic metadata for a Kubernetes resource

type LintExpression

type LintExpression struct {
	Rule      string                       `json:"rule"`
	Type      string                       `json:"type"` // "error", "warn", "info"
	Message   string                       `json:"message"`
	Path      string                       `json:"path"`
	Positions []LintExpressionItemPosition `json:"positions"`
}

LintExpression represents a single lint finding

type LintExpressionItemLinePosition

type LintExpressionItemLinePosition struct {
	Line int `json:"line"`
}

LintExpressionItemLinePosition represents a line position

type LintExpressionItemPosition

type LintExpressionItemPosition struct {
	Start LintExpressionItemLinePosition `json:"start"`
}

LintExpressionItemPosition represents the position of a lint finding in a file

type LintExpressionsByRule

type LintExpressionsByRule []LintExpression

LintExpressionsByRule implements sort.Interface for []LintExpression based on Rule field

func (LintExpressionsByRule) Len

func (a LintExpressionsByRule) Len() int

func (LintExpressionsByRule) Less

func (a LintExpressionsByRule) Less(i, j int) bool

func (LintExpressionsByRule) Swap

func (a LintExpressionsByRule) Swap(i, j int)

type LintResult

type LintResult struct {
	LintExpressions []LintExpression `json:"lintExpressions"`
	IsComplete      bool             `json:"isLintingComplete"`
}

LintResult represents the complete result of linting

func (*LintResult) ErrorCount

func (r *LintResult) ErrorCount() int

ErrorCount returns the number of errors

func (*LintResult) HasErrors

func (r *LintResult) HasErrors() bool

HasErrors returns true if the result contains any errors

func (*LintResult) HasWarnings

func (r *LintResult) HasWarnings() bool

HasWarnings returns true if the result contains any warnings

func (*LintResult) WarningCount

func (r *LintResult) WarningCount() int

WarningCount returns the number of warnings

type OPALintExpression

type OPALintExpression struct {
	Rule     string `json:"rule"`
	Type     string `json:"type"`
	Message  string `json:"message"`
	Path     string `json:"path"`
	DocIndex int    `json:"docIndex"`
	Field    string `json:"field"`
	Match    string `json:"match"`
}

OPALintExpression represents a lint expression from OPA policy evaluation

type SpecFile

type SpecFile struct {
	Name            string    `json:"name"`
	Path            string    `json:"path"`
	Content         string    `json:"content"`
	DocIndex        int       `json:"docIndex,omitempty"`
	AllowDuplicates bool      `json:"allowDuplicates"` // kotskinds can be duplicated if they are coming from secrets or configmaps
	Children        SpecFiles `json:"children"`
}

SpecFile represents a single file in a KOTS application

func (SpecFile) IsTarGz

func (f SpecFile) IsTarGz() bool

IsTarGz returns true if the file is a tar.gz or .tgz file

func (SpecFile) IsYAML

func (f SpecFile) IsYAML() bool

IsYAML returns true if the file is a YAML file

type SpecFiles

type SpecFiles []SpecFile

SpecFiles is a collection of SpecFile

func SpecFilesFromTar

func SpecFilesFromTar(reader io.Reader) (SpecFiles, error)

SpecFilesFromTar loads spec files from a tar archive

func SpecFilesFromTarGz

func SpecFilesFromTarGz(tarGz SpecFile) (SpecFiles, error)

SpecFilesFromTarGz loads spec files from a .tgz archive

func (SpecFiles) GetFile

func (fs SpecFiles) GetFile(path string) (*SpecFile, error)

GetFile returns a file by path

func (SpecFiles) Separate

func (fs SpecFiles) Separate() (SpecFiles, error)

Separate splits multi-document YAML files into individual documents

func (SpecFiles) Unnest

func (fs SpecFiles) Unnest() SpecFiles

Unnest flattens nested files (extracts children from archives)

Jump to

Keyboard shortcuts

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