utils

package
v0.0.0-...-1b40d11 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNodeQuery

func CreateNodeQuery(query string) ([]model.NodeQuery, error)

func GetNodeBandwidth

func GetNodeBandwidth(metricsMap map[string]map[string]float64) float64

func GetServiceBandwidth

func GetServiceBandwidth(metric model.MetricData) float64

func GetServiceCpuUsage

func GetServiceCpuUsage(metric model.MetricData) float64

func GetServiceDiskUsage

func GetServiceDiskUsage(metric model.MetricData) float64

func GetServiceMemoryUsage

func GetServiceMemoryUsage(metric model.MetricData) float64

func GetServiceNetworkReceive

func GetServiceNetworkReceive(metric model.MetricData) float64

func GetServiceNetworkTransmit

func GetServiceNetworkTransmit(metric model.MetricData) float64

func LoadEnvFile

func LoadEnvFile(filePath string) error

func MarshalSchemaResponse

func MarshalSchemaResponse(response *model.SchemaResponse) ([]byte, error)

func MarshalSchemaVersionResponse

func MarshalSchemaVersionResponse(response *model.SchemaVersionResponse) ([]byte, error)

func ParseIDsAndKinds

func ParseIDsAndKinds(ids, kinds string) ([]string, []string, error)

func PrepareConfigDiffRequest

func PrepareConfigDiffRequest(namespace, names, versions, organization string) (interface{}, error)

func PrepareRequestBodyFromYAMLOrJSON

func PrepareRequestBodyFromYAMLOrJSON(path string) (map[string]interface{}, error)

func PromptForPassword

func PromptForPassword() (string, error)

func ReadJSON

func ReadJSON(filePath string, out interface{}) error

func ReadSchemaFile

func ReadSchemaFile(filePath string) (string, error)

func ReadTokenFromFile

func ReadTokenFromFile() (string, error)

func ReadYAML

func ReadYAML(filePath string, out interface{}) error

func SaveSchemaResponseToYAML

func SaveSchemaResponseToYAML(response *model.SchemaResponse, filePath string) error

func SaveTokenToFile

func SaveTokenToFile(token string) error

func SaveVersionResponseToYAML

func SaveVersionResponseToYAML(response *model.SchemaVersionResponse, filePath string) error

func SaveYAMLOrJSONResponseToFile

func SaveYAMLOrJSONResponseToFile(response interface{}, filePath string) error

func SendHTTPRequest

func SendHTTPRequest(config model.HTTPRequestConfig) error

func SendHTTPRequestWithProgress

func SendHTTPRequestWithProgress(config model.HTTPRequestConfig, bar *pb.ProgressBar) error

func StringToFloat

func StringToFloat(s string) float64

func ValidateRequiredFlags

func ValidateRequiredFlags(cmd *cobra.Command, requiredFlags []string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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