ConfD User Community

Example on how to use template map function


#1

Hi, folks, I am trying to populate a map like property collection like below (it could be any number of entries in the map):

'https://server1.com', { 'property1': 'value11', 'property2': 'value21' },
'https://server2.com', { 'property1': 'value12', 'property2': 'value22' },
'https://server3.com', { 'property1': 'value13', 'property2': 'value23' },
   .......

As you can see, it is more like a map with the keys being a unique url.
I wonder if I can use template map function. The confD website has this documentation:
Template Functions

see the first template function on the page: Map

creates a key-value map of string -> interface{}

However, I am not very clear how to do it. Could you give me a concrete example?

Thanks.

Richard


#2

I think the readers of the forum cannot access the link you have provided. Please add more information. What kind of MAP do you want to use?


#3

Sorry I was using a wrong link in my original post. I have updated my post to have the correct link. I am new to confD and have never used map function before to populate the map-like property list using confD map function. The confD map function documentation only contains a few lines of description and I could not find any example. So if you can find or give me an example on how to use the map function to populate a collection of map like properties (see on top of my post), that would be great. Thanks in advance.


#4

Ok, I see.
I think there is a confusion. This forum is about different product
https://www.tail-f.com/confd-basic/.