config

package
v0.0.0-...-c85cc39 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

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

View Source
const COPYRIGHT string = `` /* 459-byte string literal not displayed */

Variables

This section is empty.

Functions

func AddProperty

func AddProperty(extensionName string, key string, value interface{}) error

Add a property

func FindProperty

func FindProperty(extensionName string, key string) (properties.Properties, error)

Search for a given property

func GetConfigurationName

func GetConfigurationName(extensionName string) (string, error)

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 PropertyEncodeDecode(encodingType string, val string, encode bool) (string, error)

func RemoveProperty

func RemoveProperty(extensionName string, key string) error

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 SetConfigFileName

func SetConfigFileName(configFileName string)

Set the config file name

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 SetConfigRootKey

func SetConfigRootKey(rootKey string)

Set the config root key

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"`
}

Jump to

Keyboard shortcuts

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