Documentation
¶
Overview ¶
################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################
################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################
################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################
################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################
Index ¶
- Constants
- Variables
- func CopyRecursive(src, destDir string) error
- func CopyToTemp(tempDir string, fileName string) (string, error)
- func ExtractKey(inputFilePath string, key string) ([]byte, error)
- func ForwardRequest(w http.ResponseWriter, req *http.Request, newURL string)
- func GetExecutableDir() (string, error)
- func GetExtensionNameFromRequest(req *http.Request) (string, url.Values, error)
- func GetHomeDir() string
- func RemoveTemp(fileName string) error
Constants ¶
const BaseURL = "/cr/v1/"
BaseURL base url api
const COPYRIGHT string = `` /* 459-byte string literal not displayed */
const CommandsRunnerConfigFileName = "commands-runner.yml"
Server config file name
const CommandsRunnerLogFileName = "commands-runner.log"
CommandsRunnerLogFileName the logFile for CR
const DefaultExtenstionManifestFile = "extension-manifest.yml"
DefaultExtenstionManifestFile
const DefaultHost = "localhost"
DefaultHost default host server
const DefaultInsecureSSL = false
DefaultInsecureSSL by defualt the request are secured.
const DefaultLanguage = "en-US"
DefaultLanguage
const DefaultOutputFormat = "text"
DefaultOutputFormat default output format
const DefaultPort = "30101"
DefaultPort default port
const DefaultPortSSL = "30103"
DefaultPortSSL default port for SSL connection
const DefaultProtocol = "http"
DefaultProtocol default protocol
const DefaultTimeout = 180
DefaultTimeout default timeout for http request
const DefaultUIMetaDataName = "default"
DefaultUIMetaDataName default ui metadata attribute
const DefaultUrl = DefaultProtocol + "://" + DefaultHost + ":" + DefaultPort
DefaultUrl default api url
const SSLCertFileName = "cr-cert.crt"
SSLCertFileName certificate file name
const SSLKeyFileName = "cr-key.pem"
SSLKeyFileName key file name
const StatesFileName = "states-file.yml"
StatesFileName the states file name to use accross the different packages
const TokenFileName = "cr-token"
TokenFileName token file name
Variables ¶
var About string
Default About
var AboutURL string
About URL
var ConfigDirectory string
ConfigDirectory directory where the config file can be found
var ConfigRootKey = "config"
ConfigRootKey default root key for the yaml config file.
var ConfigYamlFileName = "config.yml"
ConfigYamlFileName default file name for the config file.
var DefaultExtensionName string
DefaultExtensionName default extension name.
var Mock = false
Mock default false, when true all scripts are skipped
var ServerCertificatePath string
Server Certificate path
var ServerConfigDir string
Server Configuration director
var ServerKeyPath string
Server Key Path
var ServerPort string
Server Port
var ServerPortSSL string
Server Port SSL
Functions ¶
func CopyRecursive ¶
CopyRecursive copy one file (file or dir) to a destDir. If the destDir doesn't exist, it will be created.
func ForwardRequest ¶
func ForwardRequest(w http.ResponseWriter, req *http.Request, newURL string)
func GetExecutableDir ¶
GetDir returns the directory where the executable is.
func GetExtensionNameFromRequest ¶
getExtensionName from request
func RemoveTemp ¶
Types ¶
This section is empty.