Documentation
¶
Index ¶
- func ELog(log string)
- func GenerateRequestURL(baseURL string, pathToAppend string) (string, error)
- func GetAndPrintActuatorCustom(inventory Inventory, endpoint string) error
- func GetAndPrintActuatorLogs(inventory Inventory)
- func GetAndPrintKnownActuator(inventory Inventory, cmdName string) error
- func GetGenericActuatorResponse(inventory Inventory, endpoint string) (string, error)
- func GetStrBetween(input string, start string, end string) string
- func GetTerminalSize() (int, int)
- func LookupFlagInCmd(flagName string, cmd *cobra.Command) bool
- func MakeDynamicStructReader(structToExtent interface{}, jsonStr string) dynamicstruct.Reader
- func MakeHTTPCall(requestMethod string, requestURL string, authorizationHeader string, ...) (*http.Response, error)
- func MakeTable() table.Writer
- func PrettyJSON(jsonStr string) string
- func PrettyPrintActuatorEnvResponse(actuatorEnvResponseStr string)
- func PrettyPrintActuatorHealthResponse(actuatorResponse string)
- func PrettyPrintActuatorInfoResponse(actuatorResponse string)
- func PrettyPrintActuatorLinksResponse(actuatorResponse string)
- func PrettyPrintActuatorMetricsResponse(actuatorResponse string)
- func PrettyPrintJSON(jsonStr string)
- func PrintInventoryFooter(inventory Inventory)
- func PrintInventoryHeader(inventory Inventory)
- func ResponseBodyToStr(response *http.Response) (string, error)
- func SetupConfig(cmd *cobra.Command)
- func VLog(log string)
- type ActuatorEnvProperties
- type ActuatorEnvPropertySources
- type ActuatorHealthProperties
- type ActuatorInfoGitProperties
- type ActuatorInfoProperties
- type ActuatorLinks
- type ActuatorMetricsProperties
- type Config
- type Inventory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRequestURL ¶
GenerateRequestURL is a utility function to cleanly generate a URL based on the passed baseURL and path
func GetAndPrintActuatorCustom ¶
GetAndPrintActuatorCustom retrieves data a custom /actuator endpoint and prints it based on the passed params
func GetAndPrintActuatorLogs ¶
func GetAndPrintActuatorLogs(inventory Inventory)
func GetAndPrintKnownActuator ¶
GetAndPrintKnownActuator contains the logic to hit the right endpoint and print the data based on the passed cmdName
func GetGenericActuatorResponse ¶
GetGenericActuatorResponse retrieves data from a generic actuator endpoint and returns the response as a string TODO: perform better error handling to top
func GetStrBetween ¶
GetStrBetween returns the trimmed string based on the input, start and end eg -
input="class path resource [application.yml]" start="[" end="]" return="application.yml"
func GetTerminalSize ¶
func LookupFlagInCmd ¶
LookupFlagInCmd returns whether a flag is set in the cmd
func MakeDynamicStructReader ¶
func MakeDynamicStructReader(structToExtent interface{}, jsonStr string) dynamicstruct.Reader
func MakeHTTPCall ¶
func MakeHTTPCall(requestMethod string, requestURL string, authorizationHeader string, rangeHeader string, skipVerifySSL bool) (*http.Response, error)
MakeHTTPCall is a wrapper function to aid performing an HTTP call
func PrettyJSON ¶
func PrettyPrintActuatorEnvResponse ¶
func PrettyPrintActuatorEnvResponse(actuatorEnvResponseStr string)
PrettyPrintActuatorEnvResponse pretty prints the response from /actuator/env
func PrettyPrintActuatorHealthResponse ¶
func PrettyPrintActuatorHealthResponse(actuatorResponse string)
PrettyPrintActuatorHealthResponse pretty prints the response from /actuator/health
func PrettyPrintActuatorInfoResponse ¶
func PrettyPrintActuatorInfoResponse(actuatorResponse string)
PrettyPrintActuatorInfoResponse pretty prints the response from /actuator/info
func PrettyPrintActuatorLinksResponse ¶
func PrettyPrintActuatorLinksResponse(actuatorResponse string)
PrettyPrintActuatorLinksResponse pretty prints the response from /actuator
func PrettyPrintActuatorMetricsResponse ¶
func PrettyPrintActuatorMetricsResponse(actuatorResponse string)
PrettyPrintActuatorMetricsResponse pretty prints the response from /actuator/metrics
func PrettyPrintJSON ¶
func PrettyPrintJSON(jsonStr string)
PrettyPrintJSON prints a JSON string in a pretty format using the colorjson library
func PrintInventoryFooter ¶
func PrintInventoryFooter(inventory Inventory)
PrintInventoryFooter is a util function that prints a pretty Header text This is intended to be run for each Inventory - Post execution of the domain specific function
func PrintInventoryHeader ¶
func PrintInventoryHeader(inventory Inventory)
PrintInventoryHeader is a util function that prints a pretty Header text This is intended to be run for each Inventory - Prior execution of the domain specific function
func SetupConfig ¶
SetupConfig sets up the Config based on the config file and any passed params
Types ¶
type ActuatorEnvProperties ¶
type ActuatorEnvProperties struct {
ActiveProfiles []string `json:"activeProfiles"`
PropertySources []ActuatorEnvPropertySources `json:"propertySources"`
}
type ActuatorHealthProperties ¶
type ActuatorHealthProperties struct {
Status string `json:"status"`
}
type ActuatorInfoGitProperties ¶
type ActuatorInfoGitProperties struct {
Branch string `json:"branch"`
Build struct {
Host string `json:"host"`
User struct {
Email string `json:"email"`
Name string `json:"name"`
} `json:"user"`
Version string `json:"version"`
} `json:"build"`
Closest struct {
Tag struct {
Commit struct {
Count string `json:"count"`
} `json:"commit"`
Name string `json:"name"`
} `json:"tag"`
} `json:"closest"`
Commit map[string]interface{} `json:"commit"`
Dirty string `json:"dirty"`
Remote struct {
Origin struct {
URL string `json:"url"`
} `json:"origin"`
} `json:"remote"`
Tags string `json:"tags"`
Total struct {
Commit struct {
Count string `json:"count"`
} `json:"commit"`
} `json:"total"`
}
type ActuatorInfoProperties ¶
type ActuatorInfoProperties struct {
Git ActuatorInfoGitProperties `json:"git"`
Title string `json:"title"`
Build map[string]interface{} `json:"build"`
}
type ActuatorLinks ¶
type ActuatorLinks struct {
Links map[string]interface{} `json:"_links"`
}
type ActuatorMetricsProperties ¶
type ActuatorMetricsProperties struct {
Names []string `json:"names"`
}