results

package
v0.11.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UnknownVersion lets the consumer know if this client can detect the archive version or not.
	UnknownVersion = "v?.?"
)

Variables

This section is empty.

Functions

func ConfigFile

func ConfigFile(version string) string

ConfigFile returns the path to the sonobuoy config file. This is not a method as it is used to determine the version of the archive.

func DiscoverVersion

func DiscoverVersion(reader io.Reader) (string, error)

DiscoverVersion takes a Sonobuoy archive stream and extracts just the version of the archive.

func ExtractBytes

func ExtractBytes(file string, path string, info os.FileInfo, buf *bytes.Buffer) error

ExtractBytes pulls out bytes into a buffer for any path matching file.

func ExtractConfig

func ExtractConfig(path string, info os.FileInfo, conf *config.Config) error

ExtractConfig populates the config object regardless of version.

func ExtractFileIntoStruct

func ExtractFileIntoStruct(file, path string, info os.FileInfo, object interface{}) error

ExtractFileIntoStruct is a helper for a common use case of extracting the contents of one file into the object.

func ExtractIntoStruct

func ExtractIntoStruct(predicate func(string) bool, path string, info os.FileInfo, object interface{}) error

ExtractIntoStruct takes a predicate function and some file information and decodes the contents of the file that matches the predicate into the interface passed in (generally a pointer to a struct/slice).

Types

type Metadata

type Metadata struct {
	// Config is the config used during this Sonobuoy run.
	Config config.Config

	// QueryMetadata shows how long each object took to query.
	QueryData []discovery.QueryData
}

Metadata is all the stuff about the Sonobuoy run and how long it took to query the system.

type Reader

type Reader struct {
	io.Reader
	Version string
}

Reader holds a reader and a version. It uses the version to know where to find certain files within the archive stream.

func NewReaderFromBytes

func NewReaderFromBytes(data []byte) (*Reader, error)

NewReaderFromBytes is a helper constructor that will discover the version of the archive and return a new Reader with the correct version already populated.

func NewReaderWithVersion

func NewReaderWithVersion(reader io.Reader, version string) *Reader

func (*Reader) Metadata

func (a *Reader) Metadata() string

func (*Reader) NamespacedResources

func (a *Reader) NamespacedResources() string

NamespacedResources returns the path to

func (*Reader) NodesFile

func (a *Reader) NodesFile() string

NodesFile returns the path to the file listing nodes.

func (*Reader) NonNamespacedResources

func (a *Reader) NonNamespacedResources() string

NonNamespacedResources returns the path to the non-namespaced directory.

func (*Reader) ServerGroupsFile

func (a *Reader) ServerGroupsFile() string

ServerGroupsFile returns the path to the groups the k8s api supported at the time of the run.

func (*Reader) ServerVersionFile

func (a *Reader) ServerVersionFile() string

func (*Reader) WalkFiles

func (r *Reader) WalkFiles(walkfn filepath.WalkFunc) error

WalkFiles walks all of the files in the archive.

Jump to

Keyboard shortcuts

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