config

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringToLevelHookFunc added in v0.1.0

func StringToLevelHookFunc() mapstructure.DecodeHookFuncType

Types

type ContainerExcludeRules added in v0.1.0

type ContainerExcludeRules struct {
	ControllerSecurityContext KindRuleExcludeList `mapstructure:"controller-security-context"`
	DNSPolicy                 KindRuleExcludeList `mapstructure:"dns-policy"`

	HostNetworkPorts       ContainerRuleExcludeList `mapstructure:"host-network-ports"`
	Ports                  ContainerRuleExcludeList `mapstructure:"ports"`
	ReadOnlyRootFilesystem ContainerRuleExcludeList `mapstructure:"read-only-root-filesystem"`
	ImageDigest            ContainerRuleExcludeList `mapstructure:"image-digest"`
	Resources              ContainerRuleExcludeList `mapstructure:"resources"`
	SecurityContext        ContainerRuleExcludeList `mapstructure:"security-context"`
	Liveness               ContainerRuleExcludeList `mapstructure:"liveness-probe"`
	Readiness              ContainerRuleExcludeList `mapstructure:"readiness-probe"`

	Description StringRuleExcludeList `mapstructure:"description"`
}

type ContainerRuleExclude added in v0.1.0

type ContainerRuleExclude struct {
	Kind      string `mapstructure:"kind"`
	Name      string `mapstructure:"name"`
	Container string `mapstructure:"container"`
}

type ContainerRuleExcludeList added in v0.1.0

type ContainerRuleExcludeList []ContainerRuleExclude

func (ContainerRuleExcludeList) Get added in v0.1.0

type ContainerSettings

type ContainerSettings struct {
	ExcludeRules ContainerExcludeRules `mapstructure:"exclude-rules"`

	Impact *pkg.Level `mapstructure:"impact"`
}

type ConversionsRuleSettings added in v0.1.0

type ConversionsRuleSettings struct {
	// disable conversions rule completely
	Disable bool `mapstructure:"disable"`
}

type HooksIngressRuleSetting added in v0.1.0

type HooksIngressRuleSetting struct {
	// disable ingress rule completely
	Disable bool `mapstructure:"disable"`
}

type HooksSettings added in v0.1.0

type HooksSettings struct {
	Ingress HooksIngressRuleSetting `mapstructure:"ingress"`

	Impact *pkg.Level `mapstructure:"impact"`
}

type ImageExcludeRules added in v0.1.8

type ImageExcludeRules struct {
	SkipImageFilePathPrefix      PrefixRuleExcludeList `mapstructure:"skip-image-file-path-prefix"`
	SkipDistrolessFilePathPrefix PrefixRuleExcludeList `mapstructure:"skip-distroless-file-path-prefix"`
}

type ImageSettings added in v0.0.24

type ImageSettings struct {
	ExcludeRules ImageExcludeRules `mapstructure:"exclude-rules"`

	Patches PatchesRuleSettings `mapstructure:"patches"`

	Impact *pkg.Level `mapstructure:"impact"`
}

type KindRuleExclude added in v0.1.0

type KindRuleExclude struct {
	Kind string `mapstructure:"kind"`
	Name string `mapstructure:"name"`
}

type KindRuleExcludeList added in v0.1.0

type KindRuleExcludeList []KindRuleExclude

func (KindRuleExcludeList) Get added in v0.1.0

type LicenseExcludeRule added in v0.1.3

type LicenseExcludeRule struct {
	Files       StringRuleExcludeList `mapstructure:"files"`
	Directories PrefixRuleExcludeList `mapstructure:"directories"`
}

type LintersSettings

type LintersSettings struct {
	Container  ContainerSettings  `mapstructure:"container"`
	Hooks      HooksSettings      `mapstructure:"hooks"`
	Images     ImageSettings      `mapstructure:"images"`
	Module     ModuleSettings     `mapstructure:"module"`
	NoCyrillic NoCyrillicSettings `mapstructure:"no-cyrillic"`
	OpenAPI    OpenAPISettings    `mapstructure:"openapi"`
	Rbac       RbacSettings       `mapstructure:"rbac"`
	Templates  TemplatesSettings  `mapstructure:"templates"`
}

func (*LintersSettings) MergeGlobal added in v0.1.0

func (cfg *LintersSettings) MergeGlobal(lcfg *global.Linters)

type Loader

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

func NewLoader

func NewLoader(cfg any, dirs ...string) *Loader

func (*Loader) Load

func (l *Loader) Load() error

type LoaderOptions

type LoaderOptions struct {
	Config string
}

type ModuleConfig added in v0.1.0

type ModuleConfig struct {
	LintersSettings LintersSettings `mapstructure:"linters-settings"`
}

type ModuleDefinitionFileRuleSettings added in v0.1.0

type ModuleDefinitionFileRuleSettings struct {
	// disable definition-file rule completely
	Disable bool `mapstructure:"disable"`
}

type ModuleExcludeRules added in v0.1.6

type ModuleExcludeRules struct {
	License LicenseExcludeRule `mapstructure:"license"`
}

type ModuleOSSRuleSettings added in v0.1.0

type ModuleOSSRuleSettings struct {
	// disable oss rule completely
	Disable bool `mapstructure:"disable"`
}

type ModuleSettings added in v0.0.29

type ModuleSettings struct {
	ExcludeRules ModuleExcludeRules `mapstructure:"exclude-rules"`

	OSS            ModuleOSSRuleSettings            `mapstructure:"oss"`
	DefinitionFile ModuleDefinitionFileRuleSettings `mapstructure:"definition-file"`
	Conversions    ConversionsRuleSettings          `mapstructure:"conversions"`

	Impact *pkg.Level `mapstructure:"impact"`
}

type NoCyrillicExcludeRules added in v0.1.0

type NoCyrillicExcludeRules struct {
	Files       StringRuleExcludeList `mapstructure:"files"`
	Directories PrefixRuleExcludeList `mapstructure:"directories"`
}

type NoCyrillicSettings

type NoCyrillicSettings struct {
	NoCyrillicExcludeRules NoCyrillicExcludeRules `mapstructure:"exclude-rules"`

	Impact *pkg.Level `mapstructure:"impact"`
}

type OpenAPIExcludeRules added in v0.1.0

type OpenAPIExcludeRules struct {
	KeyBannedNames         []string              `mapstructure:"key-banned-names"`
	EnumFileExcludes       []string              `mapstructure:"enum"`
	HAAbsoluteKeysExcludes StringRuleExcludeList `mapstructure:"ha-absolute-keys"`
}

type OpenAPISettings

type OpenAPISettings struct {
	OpenAPIExcludeRules OpenAPIExcludeRules `mapstructure:"exclude-rules"`

	Impact *pkg.Level `mapstructure:"impact"`
}

type PatchesRuleSettings added in v0.1.8

type PatchesRuleSettings struct {
	// disable conversions rule completely
	Disable bool `mapstructure:"disable"`
}

type PrefixRuleExcludeList added in v0.1.3

type PrefixRuleExcludeList []string

func (PrefixRuleExcludeList) Get added in v0.1.3

type RBACExcludeRules added in v0.1.0

type RBACExcludeRules struct {
	Placement KindRuleExcludeList `mapstructure:"placement"`
	Wildcards KindRuleExcludeList `mapstructure:"wildcards"`
}

type RbacSettings

type RbacSettings struct {
	ExcludeRules RBACExcludeRules `mapstructure:"exclude-rules"`

	Impact *pkg.Level `mapstructure:"impact"`
}

type RootConfig added in v0.1.0

type RootConfig struct {
	GlobalSettings global.Global `mapstructure:"global"`
}

RootConfig encapsulates the config data specified in the YAML config file.

func NewDefaultRootConfig added in v0.1.0

func NewDefaultRootConfig(dirs []string) (*RootConfig, error)

type ServicePortExclude added in v0.1.0

type ServicePortExclude struct {
	Name string `mapstructure:"name"`
	Port string `mapstructure:"port"`
}

type ServicePortExcludeList added in v0.1.0

type ServicePortExcludeList []ServicePortExclude

func (ServicePortExcludeList) Get added in v0.1.0

type StringRuleExcludeList added in v0.1.0

type StringRuleExcludeList []string

func (StringRuleExcludeList) Get added in v0.1.0

type TemplatesExcludeRules added in v0.1.0

type TemplatesExcludeRules struct {
	VPAAbsent     KindRuleExcludeList    `mapstructure:"vpa"`
	PDBAbsent     KindRuleExcludeList    `mapstructure:"pdb"`
	ServicePort   ServicePortExcludeList `mapstructure:"service-port"`
	KubeRBACProxy StringRuleExcludeList  `mapstructure:"kube-rbac-proxy"`
}

type TemplatesSettings added in v0.1.0

type TemplatesSettings struct {
	ExcludeRules TemplatesExcludeRules `mapstructure:"exclude-rules"`

	Impact *pkg.Level `mapstructure:"impact"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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