parser

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package parser provides functionality for parsing and masking Kubernetes manifests.

Package parser provides utilities for parsing Kubernetes YAML and JSON manifests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseYAML

func ParseYAML(reader io.Reader) ([]*unstructured.Unstructured, error)

ParseYAML reads a YAML or JSON stream and returns unstructured objects. If the unmarshaller encounters an error, objects read up until the error are returned.

Types

type Options added in v0.0.4

type Options struct {
	FilterOption          *filter.Option // Filtering options
	DisableMaskingSecrets bool           // Disable masking of secret values (default: false)
}

Options controls the parsing and masking behavior

func DefaultOptions added in v0.0.4

func DefaultOptions() *Options

DefaultOptions returns the default parsing options

type ResourceKey added in v0.0.4

type ResourceKey struct {
	Name      string
	Namespace string
	Group     string
	Kind      string
}

ResourceKey uniquely identifies a Kubernetes resource

func (ResourceKey) String added in v0.0.4

func (k ResourceKey) String() string

String returns a string representation of the ResourceKey

type Results added in v0.0.4

Results represents a collection of resources

func Objects added in v0.0.4

func Objects(objs []*unstructured.Unstructured, opts *Options) (Results, error)

Objects processes a slice of Kubernetes objects and returns Results with optional masking and filtering

func Yaml added in v0.0.4

func Yaml(reader io.Reader, opts *Options) (Results, error)

Yaml processes YAML from an io.Reader and returns Results with optional masking

func YamlString added in v0.0.4

func YamlString(yamlStr string, opts *Options) (Results, error)

YamlString processes a YAML string and returns Results with optional masking

func (Results) String added in v0.0.4

func (r Results) String() string

String converts Results to YAML string representation

Jump to

Keyboard shortcuts

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