crds

package
v0.2.0-rc10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

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

Extractor extracts CRDs and XRDs from YAML files, and images found as part of configuration and provider definitions.

func NewExtractor

func NewExtractor(w Writer, localImageName string) *Extractor

NewExtractor creates an Extractor.

func (*Extractor) ExtractCRDs

func (d *Extractor) ExtractCRDs(inputs ...io.Reader) error

ExtractCRDs extracts CRDs and XRDs from the supplied readers, including those in images referenced in Configuration and Provider data.

type Image

type Image struct {
	Name    string
	Version string
}

Image is the image being processed for CRDs. When processing local files, the image is given a name but its version is empty.

func (Image) Filename

func (im Image) Filename() string

func (Image) String

func (im Image) String() string

type MultiWriter

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

MultiWriter delegates to one or more writers.

func NewMultiWriter

func NewMultiWriter(writers ...Writer) *MultiWriter

NewMultiWriter creates a MultiWriter.

func (*MultiWriter) EndImage

func (m *MultiWriter) EndImage() error

func (*MultiWriter) StartImage

func (m *MultiWriter) StartImage(img Image) error

func (*MultiWriter) Write

func (m *MultiWriter) Write(meta ObjectMetadata, content []byte) error

type ObjectMetadata

type ObjectMetadata struct {
	GVK       schema.GroupVersionKind
	Namespace string
	Name      string
}

ObjectMetadata is the metadata of the object that needs to be written.

func (ObjectMetadata) Filename

func (o ObjectMetadata) Filename() string

func (ObjectMetadata) String

func (o ObjectMetadata) String() string

type ProgressWriter

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

ProgressWriter is a writer that writes progress log messages when a new image is started and ended.

func NewProgressWriter

func NewProgressWriter(logger *log.Logger) *ProgressWriter

NewProgressWriter returns a progress writer.

func (*ProgressWriter) EndImage

func (w *ProgressWriter) EndImage() error

func (*ProgressWriter) StartImage

func (w *ProgressWriter) StartImage(image Image) error

func (ProgressWriter) Write

func (ProgressWriter) Write(_ ObjectMetadata, _ []byte) error

type SplitFileWriter

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

SplitFileWriter writes one file per document to an output directory.

func NewSplitFileWriter

func NewSplitFileWriter(outputDir string) (*SplitFileWriter, error)

NewSplitFileWriter creates a SplitFileWriter.

func (SplitFileWriter) EndImage

func (SplitFileWriter) EndImage() error

func (SplitFileWriter) StartImage

func (SplitFileWriter) StartImage(_ Image) error

func (*SplitFileWriter) Write

func (w *SplitFileWriter) Write(m ObjectMetadata, content []byte) error

type SplitImageWriter

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

SplitImageWriter writes a file for every image processed and an additional one for any local files.

func NewSplitImageWriter

func NewSplitImageWriter(outputDir string) (*SplitImageWriter, error)

NewSplitImageWriter creates a SplitImageWriter.

func (*SplitImageWriter) EndImage

func (w *SplitImageWriter) EndImage() error

func (*SplitImageWriter) StartImage

func (w *SplitImageWriter) StartImage(image Image) error

func (*SplitImageWriter) Write

func (w *SplitImageWriter) Write(_ ObjectMetadata, content []byte) error

type StreamWriter

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

StreamWriter writes multiple YAML documents to an output stream.

func NewStreamWriter

func NewStreamWriter(output io.Writer) *StreamWriter

NewStreamWriter creates a StreamWriter.

func (StreamWriter) EndImage

func (StreamWriter) EndImage() error

func (StreamWriter) StartImage

func (StreamWriter) StartImage(_ Image) error

func (*StreamWriter) Write

func (w *StreamWriter) Write(_ ObjectMetadata, content []byte) error

type WarningWriter

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

func NewWarningWriter

func NewWarningWriter(logger *log.Logger) *WarningWriter

NewWarningWriter returns a warning writer.

func (WarningWriter) EndImage

func (WarningWriter) EndImage() error

func (*WarningWriter) StartImage

func (w *WarningWriter) StartImage(image Image) error

func (*WarningWriter) Write

func (w *WarningWriter) Write(m ObjectMetadata, _ []byte) error

type Writer

type Writer interface {
	// StartImage is called when a new image is processed.
	StartImage(image Image) error
	// Write allows the writer to write an object of the supplied GVK (one of CRD or XRD), its name and content.
	Write(meta ObjectMetadata, content []byte) error
	// EndImage is called when the current image has been fully processed. It will always be called once
	// for every StartImage call.
	EndImage() error
}

Writer writes CRD content.

Jump to

Keyboard shortcuts

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