commonCLI

package module
v4.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

README

akamai-cli-common

Common functions used in various akamai CLI

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFlags

func CreateFlags() []cli.Flag

CreateFlags inits default flags used across all CLIs

func CreateNewApp

func CreateNewApp(appShortName, usage, version string) *cli.App

CreateNewApp returns new application

func DeleteSlicefromSlice

func DeleteSlicefromSlice(slice, delete []int) []int

DeleteSlicefromSlice deletes one slice from another and removes duplicate objects

func ErrorCheck

func ErrorCheck(e error)

ErrorCheck default error check

func GetArgumentInt

func GetArgumentInt(c *cli.Context, errMessage string) int

GetArgumentInt retrieves argument value for int

func GetArgumentStr

func GetArgumentStr(c *cli.Context, errMessage string) string

GetArgumentStr retrieves argument value for string

func HomeDir

func HomeDir() string

HomeDir set default config location

func IsRegexMatch

func IsRegexMatch(str, pattern string) bool

IsRegexMatch checks if our string matches regex

func IsStringInSlice

func IsStringInSlice(a string, list []string) bool

IsStringInSlice returns TRUE is slice contains string and false if not

func IsTypeExpected

func IsTypeExpected(s, expected interface{}) bool

IsTypeExpected checks if our object is of expected type

func OutputJSON

func OutputJSON(input interface{})

OutputJSON displays output of query for alerts in JSON format

func PrintJSON

func PrintJSON(str string)

PrintJSON pretty print JSON string

func RemoveIntDuplicates

func RemoveIntDuplicates(elements []int) []int

RemoveIntDuplicates removes duplicated elements from int array

func RemoveStringDuplicates

func RemoveStringDuplicates(str []string) []string

RemoveStringDuplicates removes duplicated elements from strings array

func StringToIntArr

func StringToIntArr(str string) (intArr []int)

StringToIntArr transform string of comma seperated words to array of ints

func StringToStringsArr

func StringToStringsArr(str string) (strArr []string)

StringToStringsArr transform string of comma seperated words to array of strings

func StringsSlicesDifference

func StringsSlicesDifference(slice1 []string, slice2 []string) []string

StringsSlicesDifference give you diff between 2 strings slices

Types

This section is empty.

Jump to

Keyboard shortcuts

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