Help us shape the future of Go! Take the 2026 Go Developer Survey

load

package
v2.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Package load provides functionality to load Kubernetes manifests from various sources

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func YamlStream

func YamlStream(r io.Reader) ([][]byte, error)

YamlStream loads a yaml stream from a reader into a 2d byte slice.

Types

type CompositeLoader

type CompositeLoader struct {
	// contains filtered or unexported fields
}

CompositeLoader acts as a composition of multiple loaders to handle loading resources from various sources at once.

func (*CompositeLoader) Load

Load implements the Loader interface by loading from all contained loaders and combining the results.

type FileLoader

type FileLoader struct {
	// contains filtered or unexported fields
}

FileLoader implements the Loader interface for reading from a file and converting input to unstructured objects.

func (*FileLoader) Load

func (f *FileLoader) Load() ([]*unstructured.Unstructured, error)

Load reads the contents from a file.

type FolderLoader

type FolderLoader struct {
	// contains filtered or unexported fields
}

FolderLoader implements the Loader interface for reading from a folder.

func (*FolderLoader) Load

func (f *FolderLoader) Load() ([]*unstructured.Unstructured, error)

Load reads the contents from all files in a folder.

type Loader

type Loader interface {
	Load() ([]*unstructured.Unstructured, error)
}

Loader interface defines the contract for different input sources.

func NewCompositeLoader

func NewCompositeLoader(sources []string) (Loader, error)

NewCompositeLoader creates a new composite loader based on the specified sources. Sources can be files, directories, or "-" for stdin. If sources is empty, stdin is used by default.

func NewLoader

func NewLoader(input string) (Loader, error)

NewLoader returns a Loader based on the input source.

type MultiLoader

type MultiLoader struct {
	// contains filtered or unexported fields
}

MultiLoader implements the Loader interface for reading from multiple other loaders.

func (*MultiLoader) Load

func (m *MultiLoader) Load() ([]*unstructured.Unstructured, error)

Load reads and merges the content from the loaders.

type StdinLoader

type StdinLoader struct{}

StdinLoader implements the Loader interface for reading from stdin.

func (*StdinLoader) Load

func (s *StdinLoader) Load() ([]*unstructured.Unstructured, error)

Load reads the contents from stdin.

Directories

Path Synopsis
Package testutils is for test utilities.
Package testutils is for test utilities.

Jump to

Keyboard shortcuts

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