parser

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchiveFetcher

type ArchiveFetcher interface {
	Fetch(archiveURL, checksum, dir string) error
}

ArchiveFetcher implementations should get the URL, validate the contents against the checksum and leave the unpacked version in the dir.

type RepositoryParser

type RepositoryParser struct {
	logr.Logger
	// contains filtered or unexported fields
}

RepositoryParser fetches archives from a Repository and parses the resources from them.

func NewRepositoryParser

func NewRepositoryParser(logger logr.Logger, fetcher ArchiveFetcher) *RepositoryParser

NewRepositoryParser creates and returns a RepositoryParser.

func (*RepositoryParser) GenerateFromDirectories

func (p *RepositoryParser) GenerateFromDirectories(ctx context.Context, archiveURL, checksum string, dirs []templatesv1.RepositoryGeneratorDirectoryItem) ([]map[string]any, error)

GenerateFromDirectories extracts the archive and processes the directories.

func (*RepositoryParser) GenerateFromFiles

func (p *RepositoryParser) GenerateFromFiles(ctx context.Context, archiveURL, checksum string, files []templatesv1.RepositoryGeneratorFileItem) ([]map[string]any, error)

GenerateFromFiles extracts the archive and processes the files.

Jump to

Keyboard shortcuts

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