Documentation ¶
Index ¶
- Constants
- func ConfigFile(version string) string
- func DiscoverVersion(reader io.Reader) (string, error)
- func ExtractBytes(file string, path string, info os.FileInfo, buf *bytes.Buffer) error
- func ExtractConfig(path string, info os.FileInfo, conf *config.Config) error
- func ExtractFileIntoStruct(file, path string, info os.FileInfo, object interface{}) error
- func ExtractIntoStruct(predicate func(string) bool, path string, info os.FileInfo, object interface{}) error
- type Metadata
- type Reader
- func (a *Reader) Metadata() string
- func (a *Reader) NamespacedResources() string
- func (a *Reader) NodesFile() string
- func (a *Reader) NonNamespacedResources() string
- func (a *Reader) ServerGroupsFile() string
- func (a *Reader) ServerVersionFile() string
- func (r *Reader) WalkFiles(walkfn filepath.WalkFunc) error
Constants ¶
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 ¶
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 ¶
DiscoverVersion takes a Sonobuoy archive stream and extracts just the version of the archive.
func ExtractBytes ¶
ExtractBytes pulls out bytes into a buffer for any path matching file.
func ExtractConfig ¶
ExtractConfig populates the config object regardless of version.
func ExtractFileIntoStruct ¶
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 ¶
Reader holds a reader and a version. It uses the version to know where to find certain files within the archive stream.
func NewReaderFromBytes ¶
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 (*Reader) NamespacedResources ¶
NamespacedResources returns the path to
func (*Reader) NonNamespacedResources ¶
NonNamespacedResources returns the path to the non-namespaced directory.
func (*Reader) ServerGroupsFile ¶
ServerGroupsFile returns the path to the groups the k8s api supported at the time of the run.