validate

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NaisManifestSchema is the path to the JSON schema for validating a nais manifest
	NaisManifestSchema = "https://storage.googleapis.com/nais-json-schema-2c91/nais-all.json"
)

Variables

This section is empty.

Functions

func ExecTemplate

func ExecTemplate(data []byte, ctx TemplateVariables, out cli.Output) ([]byte, error)

ExecTemplate evaluates a template with the given context.

func Run

func Run(files []string, flags *flag.Validate, out cli.Output) error

func YAMLToJSONMessages

func YAMLToJSONMessages(data []byte) ([]json.RawMessage, error)

YAMLToJSONMessages converts raw multi-document YAML bytes to a slice of JSON messages.

Types

type TemplateVariables

type TemplateVariables map[string]interface{}

func TemplateVariablesFromFile

func TemplateVariablesFromFile(path string) (TemplateVariables, error)

func TemplateVariablesFromSlice

func TemplateVariablesFromSlice(vars []string) TemplateVariables

type Validate

type Validate struct {
	ResourcePaths []string
	Variables     TemplateVariables
	Verbose       bool
	SchemaLoader  gojsonschema.JSONLoader
}

func New

func New(resourcePaths []string) Validate

func (Validate) Validate

func (v Validate) Validate(out cli.Output) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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