Documentation ¶
Index ¶
- Constants
- Variables
- func AllowInsecureSSLConnection()
- func CloseFile(f *os.File)
- func ContainsString(slice []string, element string) bool
- func CreateKeyValuePairs(mapData map[string]string) string
- func EnableVerboseMode()
- func GetCmdFlags(cmd string) string
- func GetCmdUsage(program, cmd, subcmd, arg string) string
- func GetCmdUsageForArgsOnly(program, cmd, subcmd string, args []string) string
- func GetCmdUsageForNonArguments(program, cmd, subcmd string) string
- func GetCmdUsageMultipleArgs(program, cmd, subcmd string, args []string) string
- func GetConfigFilePath(configFileName string) string
- func GetFileContent(filePath string) string
- func GetRESTAPIBase() string
- func GetRemoteConfigFilePath() string
- func GetSecurityDirectoryPath() string
- func GetTableWriter() *tablewriter.Table
- func GetUrlAndParams(urlPrefix, key, value string) (string, map[string]string)
- func GetkeyStoreInfoFileLocation() string
- func HandleErrorAndExit(msg string, err error)
- func InitRemoteConfigData()
- func InvokeDELETERequest(url string, headers map[string]string) (*resty.Response, error)
- func InvokeGETRequest(url string, headers map[string]string, params map[string]string) (*resty.Response, error)
- func InvokePOSTRequest(url string, headers map[string]string, body map[string]string) (*resty.Response, error)
- func InvokeUPDATERequest(url string, headers map[string]string, body map[string]string) (*resty.Response, error)
- func IsFileExist(path string) bool
- func IsValidConsoleInput(inputs map[string]string) bool
- func Logf(format string, a ...interface{})
- func Logln(a ...interface{})
- func MakeDirectoryIfNotExists(path string) error
- func NormalizeFilePath(path string) string
- func PrintItemList(itemList IterableStringArray, columnData []string, emptyWarning string)
- func PrintList(list []string)
- func PromptForPassword() string
- func PromptForUsername() string
- func PutQueryParamsToMap(paramMap map[string]string, key string, value string) map[string]string
- func SetProperties(variables map[string]string, fileName string)
- func UnmarshalData(url string, headers map[string]string, params map[string]string, ...) (interface{}, error)
- func UnmarshalJsonToStringMap(body []byte) map[string]string
- func UnmarshalLogFileData(url string, headers map[string]string, params map[string]string, ...)
- func UpdateMIEndpoint(endpointName string, intendedState string) (interface{}, error)
- func UpdateMILogger(loggerName, loggingLevel, logClass string) (interface{}, error)
- func UpdateMIMessageProcessor(messageProcessorName, messageProcessorStateValue string) (interface{}, error)
- func UpdateMIProxySerice(proxyServiceName string, intendedState string) (interface{}, error)
- func WhereAmI(depthList ...int) string
- func WriteLinesToCSVFile(lines [][]string, targetPath string)
- type IterableStringArray
- type KeyStore
- type Logger
- type LoginResponse
- type LogoutResponse
- type Remote
- type RemoteConfig
- func (remoteConfig *RemoteConfig) AddRemote(name string, host string, port string) error
- func (remoteConfig *RemoteConfig) Load(filePath string)
- func (remoteConfig *RemoteConfig) Persist(filePath string)
- func (remoteConfig *RemoteConfig) RemoveRemote(name string) error
- func (remoteConfig *RemoteConfig) Reset()
- func (remoteConfig *RemoteConfig) SelectRemote(name string) error
- func (remoteConfig *RemoteConfig) UpdateCurrentRemoteToken(accessToken string) error
- func (remoteConfig *RemoteConfig) UpdateRemote(name string, host string, port string) error
- type RemoteInfo
- type RemoteSummary
- type Remotes
- type Service
Constants ¶
const ConfigDirName = ".wso2micli"
const Context = "management"
const Count = "COUNT"
const CronExpression = "CRON EXPRESSION"
const DefaultEnvironmentName = "default"
const DefaultHost = "localhost"
const DefaultHttpRequestTimeout = 100000
const DefaultPort = "9164"
const DefaultRESTAPIBase = HTTPSProtocol + DefaultHost + ":" + DefaultPort + "/" + Context + "/"
const DefaultRemoteName = "default"
const DefaultTokenValidityPeriod = "3600"
Other
const DefaultValue = "DEFAULT VALUE"
const Description = "DESCRIPTION"
const HTTPProtocol = "http://"
DO NOT CHANGE THESE MANUALLY Default Server Address
const HTTPSProtocol = "https://"
const HeaderAccept = "Accept"
const HeaderAuthorization = "Authorization"
Headers and Header Values
const HeaderConnection = "Connection"
const HeaderConsumes = "Consumes"
const HeaderContentEncoding = "Content-Encoding"
const HeaderContentType = "Content-Type"
const HeaderProduces = "Produces"
const HeaderTransferEncoding = "transfer-encoding"
const HeaderValueApplicationJSON = "application/json"
const HeaderValueApplicationZip = "application/zip"
const HeaderValueAuthPrefixBasic = "Basic"
const HeaderValueAuthPrefixBearer = "Bearer"
const HeaderValueChunked = "chunked"
const HeaderValueGZIP = "gzip"
const HeaderValueKeepAlive = "keep-alive"
const HeaderValueMultiPartFormData = "multipart/form-data"
const HeaderValueXWWWFormUrlEncoded = "application/x-www-form-urlencoded"
const HelpCommand = "help"
const Interval = "INTERVAL"
const IsActive = "Active"
const IsMandatory = "MANDATORY"
const LogPrefixError = "[ERROR] "
const LogPrefixInfo = "[INFO] "
Logging Prefixes
const LogPrefixWarning = "[WARN] "
const LoginResource = "login"
const LogoutResource = "logout"
const Method = "METHOD"
const Name = "NAME"
const Package = "PACKAGE"
const PrefixAPIs = "apis"
const PrefixCarbonApps = "applications"
const PrefixConnectors = "connectors"
const PrefixDataServices = "data-services"
const PrefixEndpoints = "endpoints"
const PrefixInboundEndpoints = "inbound-endpoints"
const PrefixLocalEntries = "local-entries"
const PrefixLogging = "logging"
const PrefixLogs = "logs"
const PrefixMessageProcessors = "message-processors"
const PrefixMessageStores = "message-stores"
const PrefixProxyServices = "proxy-services"
const PrefixSequences = "sequences"
const PrefixServer = "server"
const PrefixServices = "services"
const PrefixTasks = "tasks"
const PrefixTemplates = "templates"
const PrefixTransactions = "transactions"
const PrefixUsers = "users"
const ProjectName = "mi"
const RemoteConfigFileName = "mi_cli_remote_config.yaml"
const SampleMainConfigFileName = "main_config.yaml.sample"
const ServerResource = "server"
const ShowCommand = "show"
const Size = "SIZE"
const Stats = "STATS"
const Status = "STATUS"
const Tracing = "TRACING"
const TransactionCountCmd = "count"
const TransactionReportCmd = "report"
const TriggerType = "TRIGGER TYPE"
const Type = "TYPE"
const Url = "URL"
const UserId = "USER_ID"
const Version = "VERSION"
const Wsdl11 = "WSDL 1.1"
const Wsdl20 = "WSDL 2.0"
Variables ¶
var ConfigDirPath = filepath.Join(HomeDirectory, ConfigDirName)
var HomeDirectory = os.Getenv("HOME")
var IsVerbose bool
var PathSeparator_ = string(os.PathSeparator)
Functions ¶
func AllowInsecureSSLConnection ¶
func AllowInsecureSSLConnection()
func ContainsString ¶
ContainsString returns true iff slice contains element
func CreateKeyValuePairs ¶
func EnableVerboseMode ¶
func EnableVerboseMode()
func GetCmdFlags ¶
func GetCmdUsage ¶
func GetCmdUsageForArgsOnly ¶
Create a usage command for a command that always get invoked with its arguments.
func GetCmdUsageMultipleArgs ¶
func GetConfigFilePath ¶
func GetFileContent ¶
func GetRESTAPIBase ¶
func GetRESTAPIBase() string
func GetRemoteConfigFilePath ¶
func GetRemoteConfigFilePath() string
func GetSecurityDirectoryPath ¶
func GetSecurityDirectoryPath() string
func GetTableWriter ¶
func GetTableWriter() *tablewriter.Table
func GetUrlAndParams ¶
func GetkeyStoreInfoFileLocation ¶
func GetkeyStoreInfoFileLocation() string
func HandleErrorAndExit ¶
func InitRemoteConfigData ¶
func InitRemoteConfigData()
func InvokeDELETERequest ¶
Invoke http-delete request using go-resty
func InvokeGETRequest ¶
func InvokeGETRequest(url string, headers map[string]string, params map[string]string) (*resty.Response, error)
Invoke http-get request using go-resty
func InvokePOSTRequest ¶
func InvokePOSTRequest(url string, headers map[string]string, body map[string]string) (*resty.Response, error)
Invoke http-post request using go-resty
func InvokeUPDATERequest ¶
func InvokeUPDATERequest(url string, headers map[string]string, body map[string]string) (*resty.Response, error)
Invoke http-put request using go-resty
func IsValidConsoleInput ¶
func NormalizeFilePath ¶
func PrintItemList ¶
func PrintItemList(itemList IterableStringArray, columnData []string, emptyWarning string)
func PromptForPassword ¶
func PromptForPassword() string
func PromptForUsername ¶
func PromptForUsername() string
func PutQueryParamsToMap ¶
func SetProperties ¶
func UnmarshalData ¶
func UnmarshalData(url string, headers map[string]string, params map[string]string, model interface{}) (interface{}, error)
Unmarshal Data from the response to the respective struct @param url: url of rest api @param headers: HTTP headers @param model: struct object @param params: parameters for the HTTP call @return struct object @return error
func UnmarshalLogFileData ¶
func UpdateMIEndpoint ¶
func UpdateMILogger ¶
func UpdateMIProxySerice ¶
func WhereAmI ¶
return a string containing the file name, function name and the line number of a specified entry on the call stack
func WriteLinesToCSVFile ¶
Given an 2-D string array and a target filePath, write the content of the array as csv values to the file.
Types ¶
type IterableStringArray ¶
type LoginResponse ¶
type LoginResponse struct {
AccessToken string `yaml:"AccessToken"`
}
type LogoutResponse ¶
type LogoutResponse struct { }
type RemoteConfig ¶
type RemoteConfig struct { Remotes Remotes `yaml:"remotes"` CurrentRemote string `yaml:"current_remote"` }
var RemoteConfigData RemoteConfig
func (*RemoteConfig) AddRemote ¶
func (remoteConfig *RemoteConfig) AddRemote(name string, host string, port string) error
func (*RemoteConfig) Load ¶
func (remoteConfig *RemoteConfig) Load(filePath string)
func (*RemoteConfig) Persist ¶
func (remoteConfig *RemoteConfig) Persist(filePath string)
func (*RemoteConfig) RemoveRemote ¶
func (remoteConfig *RemoteConfig) RemoveRemote(name string) error
func (*RemoteConfig) Reset ¶
func (remoteConfig *RemoteConfig) Reset()
func (*RemoteConfig) SelectRemote ¶
func (remoteConfig *RemoteConfig) SelectRemote(name string) error
func (*RemoteConfig) UpdateCurrentRemoteToken ¶
func (remoteConfig *RemoteConfig) UpdateCurrentRemoteToken(accessToken string) error
update the access token of the current remote
func (*RemoteConfig) UpdateRemote ¶
func (remoteConfig *RemoteConfig) UpdateRemote(name string, host string, port string) error