yamlreader

package
v0.17.3 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxExtractedFileSize = 10 * 1024 * 1024 // to limit the size of extracted files and mitigate decompression bomb lint message

)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileSet

type FileSet map[string][]byte

FileSet is a map of file names to their contents. It is a set of files that should be evaluated together. For example, it may contain applications and their profiles.

type YamlReader

type YamlReader struct {
}

func (*YamlReader) ExpandFileSet

func (u *YamlReader) ExpandFileSet(srcFiles FileSet) ([]FileSet, error)

ExpandFileSet takes a FileSet and returns a set of FileSets. If srcFiles contains tarballs, then they are expanded into individual FileSets. Thus, the return value of ExpandFileSets() is a list of FileSets

  • one for each taball
  • one for the set of raw yaml files that are not part of a tarball.

func (*YamlReader) LoadYamlSpecs

func (u *YamlReader) LoadYamlSpecs(files FileSet) (upload.YamlSpecs, error)

LoadYamlSpecs processes each file in a fileset and parses and validates the YAML.

func (*YamlReader) ReadApplication

func (u *YamlReader) ReadApplication(d upload.YamlSpec, f FileSet) (*catalogv3.Application, error)

ReadApplication converts an upload.YamlSpec into an Application object.

func (*YamlReader) ReadArtifact

func (u *YamlReader) ReadArtifact(d upload.YamlSpec) (*catalogv3.Artifact, error)

ReadArtifact converts an upload.YamlSpec into an Artifact object.

func (*YamlReader) ReadDeploymentPackage

func (u *YamlReader) ReadDeploymentPackage(d upload.YamlSpec) (*catalogv3.DeploymentPackage, error)

ReadDeploymentPackage converts an upload.YamlSpec into a DeploymentPackage object.

func (*YamlReader) ReadRegistry

func (u *YamlReader) ReadRegistry(d upload.YamlSpec) (*catalogv3.Registry, error)

ReadRegistry converts an upload.YamlSpec into a Registry object.

func (*YamlReader) ReadYamlFilesFromDir

func (u *YamlReader) ReadYamlFilesFromDir(dir string) (FileSet, error)

ReadYamlFilesFromDir reads a directly and return a FileSet of all the YAML files

Jump to

Keyboard shortcuts

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