Documentation ¶
Index ¶
- Constants
- Variables
- func BinaryLocation() (string, error)
- func CacheDir() (string, error)
- func ConfigDir() (string, error)
- func Confirm(message string, defaultValue bool, help string) bool
- func CopyDir(src string, dst string, force bool) (err error)
- func CopyDirOverwrite(src string, dst string) (err error)
- func CopyFile(src, dst string) (err error)
- func CreateUniqueDirectory(dir string, name string, maximumAttempts int) (string, error)
- func DownloadArtifactoryFile(url string, filepath string) (err error)
- func DownloadFile(filepath string, url string) (err error)
- func DownloadGitHubReleaseAsset(fullUrl string, filepath string) (err error)
- func EdgeControllerCreate(entityType string, body string, out io.Writer, logJSON bool, timeout int, ...) (*gabs.Container, error)
- func EdgeControllerDelete(entityType string, id string, out io.Writer, logJSON bool, timeout int, ...) (*gabs.Container, error)
- func EdgeControllerDetailEntity(entityType, entityId string, logJSON bool, out io.Writer, timeout int, ...) (*gabs.Container, error)
- func EdgeControllerList(path string, params url.Values, logJSON bool, out io.Writer, timeout int, ...) (*gabs.Container, error)
- func EdgeControllerListSubEntities(entityType, subType, entityId string, filter string, logJSON bool, ...) (*gabs.Container, error)
- func EdgeControllerLogin(url string, cert string, authentication string, out io.Writer, logJSON bool, ...) (*gabs.Container, error)
- func EdgeControllerRequest(entityType string, out io.Writer, logJSON bool, timeout int, verbose bool, ...) (*gabs.Container, error)
- func EdgeControllerUpdate(entityType string, body string, out io.Writer, method string, ...) (*gabs.Container, error)
- func EdgeControllerVerify(entityType, id, body string, out io.Writer, logJSON bool, timeout int, ...) error
- func EnvironmentsDir() (string, error)
- func FabricConfigDir() (string, error)
- func FileExists(path string) (bool, error)
- func FirstNotEmptyString(values ...string) string
- func GetArtifactoryPath(staging bool, appName string, branch string) string
- func GetCommandOutput(dir string, name string, args ...string) (string, error)
- func GetLatestGitHubReleaseAsset(verbose bool, appName string) (string, error)
- func GetLatestGitHubReleaseVersion(verbose bool, appName string) (semver.Version, error)
- func GetLatestSemanticVersionFromArtifactory(verbose bool, staging bool, branch string, appName string, ...) (semver.Version, error)
- func GetLatestTerraformProviderVersionFromArtifactory(branch string, provider string) (semver.Version, error)
- func GetLatestVersionFromArtifactory(verbose bool, staging bool, branch string, appName string) (semver.Version, error)
- func GetTerraformProviderArtifactoryPath(provider string, branch string) string
- func HomeDir() string
- func InvalidArg(value string, values []string) error
- func InvalidArgError(value string, err error) error
- func InvalidArgf(value string, message string, a ...interface{}) error
- func InvalidOption(name string, value string, values []string) error
- func InvalidOptionError(option string, value string, err error) error
- func InvalidOptionf(option string, value string, message string, a ...interface{}) error
- func IsEmpty(name string) (bool, error)
- func LoadBytes(dir, name string) ([]byte, error)
- func MissingOption(name string) error
- func NewEmptyParentCmd(name string, description string) *cobra.Command
- func NewEnvironmentDir(envName string) (string, error)
- func PKIRootDir() (string, error)
- func Pad(s, pad string, width int, align int) string
- func PadCenter(s, pad string, width int) string
- func PadLeft(s, pad string, width int) string
- func PadRight(s, pad string, width int) string
- func PathWithBinary() string
- func PickName(names []string, message string) (string, error)
- func PickNameWithDefault(names []string, message string, defaultValue string) (string, error)
- func PickNames(names []string, message string) ([]string, error)
- func PickPassword(message string) (string, error)
- func PickRequiredNameWithDefault(names []string, message string, defaultValue string) (string, error)
- func PickValue(message string, defaultValue string, required bool) (string, error)
- func ReadZitiAppConfigFile(zitiApp string, configData interface{}) error
- func ReadZitiAppFile(zitiApp string, fileType string, configData interface{}) error
- func RegexpSplit(text string, regexSeperator string) []string
- func RenameDir(src string, dst string, force bool) (err error)
- func RenameFile(src string, dst string) (err error)
- func ReverseStrings(a []string)
- func RunAWSCommand(args ...string) error
- func RunCommand(dir string, name string, args ...string) error
- func SelectNames(names []string, message string, selectAll bool) ([]string, error)
- func SelectNamesWithFilter(names []string, message string, selectAll bool, filter string) ([]string, error)
- func SortedMapKeys(m map[string]string) []string
- func StringArrayIndex(array []string, value string) int
- func StringArrayToLower(values []string) []string
- func StringIndexes(text string, value string) []int
- func StringMatchesAny(text string, includes []string, excludes []string) bool
- func StringMatchesPattern(text string, pattern string) bool
- func SuggestionsFor(typedName string, values []string, suggestionsMinimumDistance int, ...) []string
- func TerraformProviderBinaryLocation() (string, error)
- func UnTargz(tarball, target string, onlyFiles []string) error
- func Unzip(src, dest string) error
- func WriteZitiAppConfigFile(zitiApp string, configData interface{}) error
- func WriteZitiAppFile(zitiApp string, fileType string, appData interface{}) error
- func ZitiAppConfigDir(zitiApp string) (string, error)
- type AQLResult
- type AQLVars
- type ArtifactoryAQLData
- type ArtifactoryStorageChildrenData
- type ArtifactoryStorageData
- type ArtifactoryVersionsData
- type Data
- type GitHubReleasesData
- type Session
Constants ¶
const ( DefaultWritePermissions = 0760 MaximumNewDirectoryAttempts = 1000 )
const ( ALIGN_LEFT = 0 ALIGN_CENTER = 1 ALIGN_RIGHT = 2 )
const (
CONFIGFILENAME = "config"
)
const (
DefaultSuggestionsMinimumDistance = 2
)
Variables ¶
var ColorError = color.New(color.FgRed).SprintFunc()
var ColorInfo = color.New(color.FgGreen).SprintFunc()
var ColorStatus = color.New(color.FgBlue).SprintFunc()
var ColorWarning = color.New(color.FgYellow).SprintFunc()
Functions ¶
func BinaryLocation ¶
func CopyDirOverwrite ¶
CopyDirOverwrite copies from the source dir to the destination dir overwriting files along the way
func CreateUniqueDirectory ¶
CreateUniqueDirectory creates a new directory but if the combination of dir and name exists then append a number until a unique name is found
func DownloadArtifactoryFile ¶
DownloadArtifactoryFile will download a file from the given Artifactory URL
func DownloadFile ¶
Download a file from the given URL
func DownloadGitHubReleaseAsset ¶ added in v0.16.3
DownloadGitHubReleaseAsset will download a file from the given GitHUb release area
func EdgeControllerCreate ¶
func EdgeControllerCreate(entityType string, body string, out io.Writer, logJSON bool, timeout int, verbose bool) (*gabs.Container, error)
EdgeControllerCreate will create entities of the given type in the given Edge Controller
func EdgeControllerDelete ¶
func EdgeControllerDelete(entityType string, id string, out io.Writer, logJSON bool, timeout int, verbose bool) (*gabs.Container, error)
EdgeControllerDelete will delete entities of the given type in the given Edge Controller
func EdgeControllerDetailEntity ¶ added in v0.15.1
func EdgeControllerList ¶
func EdgeControllerList(path string, params url.Values, logJSON bool, out io.Writer, timeout int, verbose bool) (*gabs.Container, error)
EdgeControllerList will list entities of the given type in the given Edge Controller
func EdgeControllerListSubEntities ¶
func EdgeControllerListSubEntities(entityType, subType, entityId string, filter string, logJSON bool, out io.Writer, timeout int, verbose bool) (*gabs.Container, error)
EdgeControllerListSubEntities will list entities of the given type in the given Edge Controller
func EdgeControllerLogin ¶
func EdgeControllerLogin(url string, cert string, authentication string, out io.Writer, logJSON bool, timeout int, verbose bool) (*gabs.Container, error)
EdgeControllerLogin will authenticate to the given Edge Controller
func EdgeControllerRequest ¶
func EdgeControllerUpdate ¶
func EdgeControllerUpdate(entityType string, body string, out io.Writer, method string, logRequestJson, logResponseJSON bool, timeout int, verbose bool) (*gabs.Container, error)
EdgeControllerUpdate will update entities of the given type in the given Edge Controller
func EdgeControllerVerify ¶
func EdgeControllerVerify(entityType, id, body string, out io.Writer, logJSON bool, timeout int, verbose bool) error
EdgeControllerVerify will create entities of the given type in the given Edge Controller
func EnvironmentsDir ¶
func FabricConfigDir ¶
func FileExists ¶
func FirstNotEmptyString ¶
FirstNotEmptyString returns the first non empty string or the empty string if none can be found
func GetArtifactoryPath ¶
func GetCommandOutput ¶
GetCommandOutput evaluates the given command and returns the trimmed output
func GetLatestGitHubReleaseAsset ¶ added in v0.16.3
func GetLatestGitHubReleaseVersion ¶ added in v0.16.3
func InvalidArg ¶
func InvalidArgError ¶
func InvalidArgf ¶
func InvalidOptionf ¶
func MissingOption ¶
func NewEmptyParentCmd ¶
NewEmptyParentCmd creates a new cobra command with no parent
func NewEnvironmentDir ¶
func PKIRootDir ¶
func PathWithBinary ¶
func PathWithBinary() string
func PickNameWithDefault ¶
func PickPassword ¶
func ReadZitiAppConfigFile ¶
ReadZitiAppConfigFile reads in the config file data for the given Ziti application from an appropriate location
func ReadZitiAppFile ¶
ReadZitiAppFile reads application data (config, session, preferences, etc) for the given Ziti application from an appropriate location
func RegexpSplit ¶
RegexpSplit splits a string into an array using the regexSep as a separator
func RenameFile ¶
func ReverseStrings ¶
func ReverseStrings(a []string)
func RunAWSCommand ¶
RunAWSCommand evaluates the given AWS CLI command and returns the trimmed output
func RunCommand ¶
RunCommand evaluates the given command and returns the trimmed output
func SelectNames ¶
SelectNames select which names from the list should be chosen
func SelectNamesWithFilter ¶
func SelectNamesWithFilter(names []string, message string, selectAll bool, filter string) ([]string, error)
SelectNamesWithFilter selects from a list of names with a given filter. Optionally selecting them all
func SortedMapKeys ¶
SortedMapKeys returns the sorted keys of the given map
func StringArrayIndex ¶
func StringArrayToLower ¶
StringArrayToLower returns a string slice with all the values converted to lower case
func StringIndexes ¶
StringIndexes returns all the indices where the value occurs in the given string
func StringMatchesAny ¶
StringMatches returns true if the given text matches the includes/excludes lists
func StringMatchesPattern ¶
StringMatchesPattern returns true if the given text matches the includes/excludes lists
func SuggestionsFor ¶
func TerraformProviderBinaryLocation ¶
TerraformProviderBinaryLocation provides the proper location to place a Terraform provider based on the currently running OS. In Mac/Linux, it's `~/.terraform.d/plugins` and on Windows it's `%APPDATA%\terraform.d\plugins`
func UnTargz ¶
untargz a tarball to a target, from http://blog.ralch.com/tutorial/golang-working-with-tar-and-gzip
func WriteZitiAppConfigFile ¶
WriteZitiAppConfigFile writes out the config file data for the given Ziti application to the appropriate config file
func WriteZitiAppFile ¶
WriteZitiAppFile writes application data (config, session, preferences, etc) to an appropriate location
func ZitiAppConfigDir ¶
Types ¶
type AQLResult ¶
type AQLResult struct { Repo string Path string Name string Type string Size int Created string CreatedBy string Modified string ModifiedBy string Updated string Properties []struct { Key string Value string } }
Used to parse the '/api/search/aql' response from Artifactory
type ArtifactoryAQLData ¶
type ArtifactoryAQLData struct {
Results []AQLResult
}
type ArtifactoryStorageChildrenData ¶
Used to parse the '/api/storage' response from Artifactory
func GetCurrentSnapshotListFromArtifactory ¶
func GetCurrentSnapshotListFromArtifactory(verbose bool) ([]ArtifactoryStorageChildrenData, error)
type ArtifactoryStorageData ¶
type ArtifactoryVersionsData ¶
type ArtifactoryVersionsData struct { Version string `json:"version"` Artifacts []struct { } }
Used to parse the '/api/versions' response from Artifactory
type GitHubReleasesData ¶ added in v0.16.3
type GitHubReleasesData struct { Version string `json:"tag_name"` Assets []struct { BrowserDownloadURL string `json:"browser_download_url"` } }
Used to parse the '/releases/latest' response from GitHub