dumper

package
v0.0.0-...-7807a54 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Dumper provides means to dump a UnstructuredList returned by a dynamic client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirDumper

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

DirDumper writes objects to a directory. Must be initialized with newDirDumper. Must be closed after use.

func NewDirDumper

func NewDirDumper(dir string) (*DirDumper, error)

NewDirDumper creates a new dirDumper that writes objects to the given directory. The directory will be created if it does not exist. If the directory cannot be created, an error is returned.

func (*DirDumper) Close

func (d *DirDumper) Close() error

Close closes the dirDumper and all open files. The dirDumper cannot be used after it is closed.

func (*DirDumper) Dump

Dump writes the objects in the list to the directory. The objects are written to the directory in two ways: - All objects are written to a file named objects-<kind>.json - Objects with a namespace are written to a directory named split/<namespace> with two files:

  • __all__.json contains all objects in the namespace
  • <kind>.json contains all objects of the kind in the namespace

If an object cannot be written, an error is returned. This method is not safe for concurrent use.

type DumperFunc

type DumperFunc func(*unstructured.UnstructuredList) error

Dumper is an interface for dumping a list of unstructured objects

func DumpToWriter

func DumpToWriter(w io.Writer) DumperFunc

DumpToWriter dumps the list of unstructured objects to the provided writer as JSON

Jump to

Keyboard shortcuts

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