util

package
v0.0.51 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderAWS   = "AWS"
	ProviderAzure = "Azure"
)

Variables

This section is empty.

Functions

func CheckAPIKeyFlag

func CheckAPIKeyFlag(apiKey string, userProfile string) (string, error)

CheckAPIKeyFlag flag check for api key

func CheckCloudAddFlags

func CheckCloudAddFlags(externalID, roleArn, roleName, environment string) error

CheckCloudAddFlags flag check for cloud add command

func CheckCloudAddFlagsForAWS added in v0.0.31

func CheckCloudAddFlagsForAWS(externalID, roleArn, roleName, environment string) error

CheckCloudAddFlags flag check for cloud add command when adding AWS cloud account

func CheckCloudAddFlagsForAzure added in v0.0.31

func CheckCloudAddFlagsForAzure(keyValue, applicationID, directoryID, subscriptionID, environment string) error

CheckCloudAddFlags flag check for cloud add command when adding azure cloud account

func CheckCloudShowOrDeleteFlag

func CheckCloudShowOrDeleteFlag(accountNumber string, verbose bool) error

CheckCloudShowOrDeleteFlag flags check for cloud show or delete command

func CheckProviderFlag added in v0.0.31

func CheckProviderFlag(provider string) error

func CheckTokenShowOrDeleteFlag

func CheckTokenShowOrDeleteFlag(tokenID string, verbose bool) error

CheckTokenShowOrDeleteFlag flag check for token show or delete command

func CreateFile

func CreateFile(name, path, content string, override bool) error

CreateFile create a file

func CreateFolder

func CreateFolder(name, path string) error

CreateFolder create folder

func GetValueFromConfig

func GetValueFromConfig(key string, masked bool) (value string)

GetValueFromConfig to get values from config

func PrettyJSON added in v0.0.3

func PrettyJSON(obj interface{}) string

PrettyJSON return pretty json

func PrettyPrintJSON

func PrettyPrintJSON(obj interface{})

PrettyPrintJSON pretty print json

func PrintError

func PrintError(err error, json bool)

PrintError print error

func PrintResult

func PrintResult(out io.Writer, t interface{}, headers []string, headersMap map[string]string, json, verbose bool)

PrintResult print result

func SaveViperConfig

func SaveViperConfig() error

SaveViperConfig Save viper config to file

func UpdateConfig

func UpdateConfig(key, value string)

UpdateConfig update value in config

Types

type Table

type Table struct {
	HeaderMap   map[string]string
	Header      []string
	Rows        [][]interface{}
	MaxCellSize int
}

Table struct

func NewTable

func NewTable() *Table

NewTable create new table

func (*Table) Render

func (c *Table) Render() string

Render table

func (*Table) SetHeader

func (c *Table) SetHeader(header []string) *Table

SetHeader set header for table

func (*Table) SetHeaderMap added in v0.0.2

func (c *Table) SetHeaderMap(headerMap map[string]string) *Table

SetHeaderMap set headerMap for table

func (*Table) SetMaxCellSize

func (c *Table) SetMaxCellSize(maxCellSize int) *Table

SetMaxCellSize set max cell size

func (*Table) UseObj

func (c *Table) UseObj(obj interface{}) *Table

UseObj Serialize obj to table

Jump to

Keyboard shortcuts

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