collector

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Version resource version
	Version = "v1"
	// Kind resource kind
	Kind = "NodeInfo"
)
View Source
const (
	// WorkerNode worker node type
	WorkerNode = "worker"
	// MasterNode master Node type
	MasterNode = "master"
)

Variables

This section is empty.

Functions

func CollectNodeData

func CollectNodeData(cmd *cobra.Command) error

CollectNodeData run spec audit command and output it result data

func LoadConfig

func LoadConfig() (map[string]*SpecInfo, error)

LoadConfig load audit commands specification from config file

func SanitizeString

func SanitizeString(output string, replaceable map[string]string) string

SanitizeString snitize string from special characters

func StringToArray

func StringToArray(output string, delimiter string) []interface{}

StringToArray convert string with delimiter to array

Types

type Collector

type Collector struct {
	Key      string `yaml:"key"`
	Title    string `yaml:"title"`
	Audit    string `yaml:"audit"`
	NodeType string `yaml:"nodeType"`
}

Collector details of info to collect

type Info added in v0.0.2

type Info struct {
	Values interface{} `json:"values"`
}

Info comand output result

type Node

type Node struct {
	APIVersion string            `json:"apiVersion"`
	Kind       string            `json:"kind"`
	Metadata   map[string]string `json:"metadata"`
	Type       string            `json:"type"`
	Info       map[string]*Info  `json:"info"`
}

Node output node data with info results

type Shell

type Shell interface {
	Execute(commandArgs string) (string, error)
	FindNodeType() (string, error)
}

Shell command interface to preform shell exec commands

func NewShellCmd

func NewShellCmd() Shell

NewShellCmd instansiate new shell command

type SpecInfo

type SpecInfo struct {
	Version    string      `yaml:"version"`
	Name       string      `yaml:"name"`
	Title      string      `yaml:"title"`
	Collectors []Collector `yaml:"collectors"`
}

SpecInfo spec info with require comand to collect

Jump to

Keyboard shortcuts

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