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. ################################################################################
File contains generic code to manage the uiconfig
Index ¶
- Constants
- func AddProperty(extensionName string, key string, value interface{}) error
- func FindProperty(extensionName string, key string) (properties.Properties, error)
- func GetConfigurationName(extensionName string) (string, error)
- func GetProperties(extensionName string) (properties.Properties, error)
- func GetPropertiesEndpoint(w http.ResponseWriter, req *http.Request)
- func HandleConfig(w http.ResponseWriter, req *http.Request)
- func PropertiesEncodeDecode(extensionName string, uiMetadataName string, ps properties.Properties, ...) (properties.Properties, error)
- func PropertyEncodeDecode(encodingType string, val string, encode bool) (string, error)
- func RemoveProperty(extensionName string, key string) error
- func SearchUIConfigProperty(extensionName, uiMetaDataName string, name string) (*config.Config, error)
- func SetConfigFileName(configFileName string)
- func SetConfigPath(configDirectoryP string)
- func SetConfigRootKey(rootKey string)
- func SetProperties(extensionName string, ps properties.Properties) error
- func SetPropertiesEndpoint(w http.ResponseWriter, req *http.Request)
- type Config
Constants ¶
const COPYRIGHT string = `` /* 459-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func AddProperty ¶
Add a property
func FindProperty ¶
func FindProperty(extensionName string, key string) (properties.Properties, error)
Search for a given property
func GetConfigurationName ¶
Search the configuration_name property
func GetProperties ¶
func GetProperties(extensionName string) (properties.Properties, error)
Read the property file and populate the map. If read can not be done, the error is forwarded
func GetPropertiesEndpoint ¶
func GetPropertiesEndpoint(w http.ResponseWriter, req *http.Request)
Retrieve all properties URL: /cr/v1/config/ Method: GET
func HandleConfig ¶
func HandleConfig(w http.ResponseWriter, req *http.Request)
handle COnfig rest api requests
func PropertiesEncodeDecode ¶
func PropertiesEncodeDecode(extensionName string, uiMetadataName string, ps properties.Properties, encode bool) (properties.Properties, error)
Encode decode properties
func PropertyEncodeDecode ¶
func RemoveProperty ¶
Remove a property from the map
func SearchUIConfigProperty ¶
func SearchUIConfigProperty(extensionName, uiMetaDataName string, name string) (*config.Config, error)
Search a property in a ui config object, return an error if not found
func SetConfigPath ¶
func SetConfigPath(configDirectoryP string)
Set the config path and read the properties If property file not present, an empty file is created The Listener stops if the file can not be created
func SetProperties ¶
func SetProperties(extensionName string, ps properties.Properties) error
Save the property map in the property file Reread the file afterward
func SetPropertiesEndpoint ¶
func SetPropertiesEndpoint(w http.ResponseWriter, req *http.Request)
Set the properties URL: /cr/v1/config/ Method: POST
Types ¶
type Config ¶
type Config struct {
Properties properties.Properties `json:"config" yaml:"config"`
}