validate

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: MIT Imports: 12 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) ([]byte, error)

ExecTemplate evaluates a template with the given context.

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() error

Jump to

Keyboard shortcuts

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