oldconfigs

package
v0.0.0-...-0da46e6 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CategorizeYAMLFile

func CategorizeYAMLFile(data []byte, dataSource string) (interface{}, error)

Returns either a *ConstraintTemplate or a *Constraint or an error dataSource should be helpful documentation to help rediscover the source of this information.

Types

type Constraint

type Constraint struct {
	Confg *UnclassifiedConfig
}

Constraint stores parsed information including the raw data.

func (*Constraint) AsProto

func (c *Constraint) AsProto() (*validator.Constraint, error)

AsProto returns the constraint a Kubernetes proto

type ConstraintTemplate

type ConstraintTemplate struct {
	Confg *UnclassifiedConfig
	// This is the kind that this template generates.
	GeneratedKind string
	Rego          string
}

ConstraintTemplate stores parsed information including the raw data.

type UnclassifiedConfig

type UnclassifiedConfig struct {
	Group        string
	MetadataName string
	Kind         string
	Yaml         *simpleyaml.Yaml
	// keep the file path to help debug logging
	FilePath string
	// Preserve the raw user data to forward into rego
	// This prevents any data loss issues from going though parsing libraries.
	RawFile string
}

UnclassifiedConfig stores loosely parsed information not specific to constraints or templates.

func (*UnclassifiedConfig) AsInterface

func (c *UnclassifiedConfig) AsInterface() (interface{}, error)

AsInterface returns the the config data as a structured golang object. This uses yaml.Unmarshal to create this object.

Jump to

Keyboard shortcuts

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