util

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAPIKeyFlag

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

CheckAPIKeyFlag flag check for api key

func CheckArgsCount

func CheckArgsCount(args []string)

CheckArgsCount check for args

func CheckCloudAddFlags

func CheckCloudAddFlags(resourceName, resourceKey, resourceSecret string) error

CheckCloudAddFlags flag check for cloud add command

func CheckCloudShowOrDeleteFlag

func CheckCloudShowOrDeleteFlag(cloudID string, verbose bool) error

CheckCloudShowOrDeleteFlag flags check for cloud show or delete command

func CheckCompositeCreateFlags

func CheckCompositeCreateFlags(name, gitRepoURL string) error

CheckCompositeCreateFlags flags check for composite create command

func CheckCompositeIDAndPlandIDFlag

func CheckCompositeIDAndPlandIDFlag(compositeID, planID string, verbose bool) error

CheckCompositeIDAndPlandIDFlag Check for compositeID and planID

func CheckCompositeShowOrDeleteFlag

func CheckCompositeShowOrDeleteFlag(compositeID string, verbose bool) error

CheckCompositeShowOrDeleteFlag flag check for composite show or delete command

func CheckExtendFlags

func CheckExtendFlags(gitRepoURL string) error

CheckExtendFlags flag check for composite extend command

func CheckGitInstall

func CheckGitInstall() error

CheckGitInstall check if user has git installed

func CheckGitKeyAddFlags

func CheckGitKeyAddFlags(name, secret string) error

CheckGitKeyAddFlags flag check for git key add command

func CheckGitKeyShowOrDeleteFlag

func CheckGitKeyShowOrDeleteFlag(gitKeyID string, verbose bool) error

CheckGitKeyShowOrDeleteFlag flag check for Git key show or delete command

func CheckLayersFlags

func CheckLayersFlags(name, gitRepoURL string) error

CheckLayersFlags flag check for composite layer command

func CheckPlanCreateJSONFileFlag added in v0.0.3

func CheckPlanCreateJSONFileFlag(file string) error

CheckPlanCreateJSONFileFlag Check for JSON file

func CheckPlanInitRequiredFlags added in v0.0.3

func CheckPlanInitRequiredFlags(compositeID, cloudID, name string) error

CheckPlanInitRequiredFlags Required flags check

func CheckSecretKeyFlag

func CheckSecretKeyFlag(secretKey string, userProfile string) (string, error)

CheckSecretKeyFlag flag check for secret key

func CheckTeamAddFlags added in v0.0.7

func CheckTeamAddFlags(teamName, teamDescription string) error

CheckTeamAddFlags Required flags check

func CheckTeamIDFlag

func CheckTeamIDFlag(teamID, userProfile string, verbose bool) (string, error)

CheckTeamIDFlag flag check for team id

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 CreateGitSubmodule

func CreateGitSubmodule(directory, gitRepoURL string) error

CreateGitSubmodule create composite git submodule

func GetRepoNameFromGitURL added in v0.0.7

func GetRepoNameFromGitURL(gitURL string) string

GetRepoNameFromGitURL get repo name from gitURL

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