Documentation
¶
Index ¶
- Constants
- type FileSet
- type YamlReader
- func (u *YamlReader) ExpandFileSet(srcFiles FileSet) ([]FileSet, error)
- func (u *YamlReader) LoadYamlSpecs(files FileSet) (upload.YamlSpecs, error)
- func (u *YamlReader) ReadApplication(d upload.YamlSpec, f FileSet) (*catalogv3.Application, error)
- func (u *YamlReader) ReadArtifact(d upload.YamlSpec) (*catalogv3.Artifact, error)
- func (u *YamlReader) ReadDeploymentPackage(d upload.YamlSpec) (*catalogv3.DeploymentPackage, error)
- func (u *YamlReader) ReadRegistry(d upload.YamlSpec) (*catalogv3.Registry, error)
- func (u *YamlReader) ReadYamlFilesFromDir(dir string) (FileSet, error)
Constants ¶
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 ¶
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 ¶
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 ¶
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