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 ¶
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 ¶
Close closes the dirDumper and all open files. The dirDumper cannot be used after it is closed.
func (*DirDumper) Dump ¶
func (d *DirDumper) Dump(l *unstructured.UnstructuredList) error
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