-
Notifications
You must be signed in to change notification settings - Fork 8
/
datalist.go
42 lines (33 loc) · 1.01 KB
/
datalist.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Copyright © 2019 M.Watermann, 10247 Berlin, Germany
All rights reserved
EMail : <[email protected]>
*/
package kaliber
/*
* This file provides an object whose properties are to be inserted
* into templates.
*/
type (
// TemplateData is a list of values to be injected into a template.
TemplateData map[string]interface{}
)
// Set inserts `aValue` identified by `aKey` to the list.
//
// If there's already a list entry with `aKey` its current value
// gets replaced by `aValue`.
//
// `aKey` is the values's identifier (as used as placeholder in the template).
//
// `aValue` contains the data entry's value.
func (dl *TemplateData) Set(aKey string, aValue interface{}) *TemplateData {
(*dl)[aKey] = aValue
return dl
} // Set()
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
// NewTemplateData returns a new (empty) `TDataList` instance.
func NewTemplateData() *TemplateData {
result := make(TemplateData, 32)
return &result
} // NewTemplateData()
/* _EoF_ */