Documentation
¶
Overview ¶
Package template serves to isolate the large number of public functions created by template_funcs.go. As this file is a copy of the version from confd, it is as unmodified as possible so as to allow for effective diffing when updates occur upstream. This package also exposes 2 of the private functions so they can be consumed by the clconf package.
Index ¶
- func AddFuncs(out, in map[string]interface{})
- func Base64Decode(data string) (string, error)
- func Base64Encode(data string) string
- func CreateMap(values ...interface{}) (map[string]interface{}, error)
- func EscapeOsgi(data string) string
- func Fqdn(hostname, domain string) string
- func Getenv(key string, v ...string) string
- func LookupIP(data string) []string
- func LookupIPV4(data string) []string
- func LookupIPV6(data string) []string
- func LookupSRV(service, proto, name string) []*net.SRV
- func NewFuncMap(s *memkv.Store) map[string]interface{}
- func RegexReplace(regex, src, repl string) (string, error)
- func Reverse(values interface{}) interface{}
- func Seq(first, last int) []int
- func SortByLength(values []string) []string
- func SortKVByLength(values []memkv.KVPair) []memkv.KVPair
- func UnmarshalJsonArray(data string) ([]interface{}, error)
- func UnmarshalJsonObject(data string) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
func CreateMap ¶
CreateMap creates a key-value map of string -> interface{} The i'th is the key and the i+1 is the value
func EscapeOsgi ¶
func Getenv ¶
Getenv retrieves the value of the environment variable named by the key. It returns the value, which will the default value if the variable is not present. If no default value was given - returns "".
func LookupIPV4 ¶
func LookupIPV6 ¶
func NewFuncMap ¶
func RegexReplace ¶
RegexReplace maps to regexp.ReplaceAllString
func Reverse ¶
func Reverse(values interface{}) interface{}
Reverse returns the array in reversed order works with []string and []KVPair
func Seq ¶
Seq creates a sequence of integers. It's named and used as GNU's seq. Seq takes the first and the last element as arguments. So Seq(3, 5) will generate [3,4,5]
func SortByLength ¶
func UnmarshalJsonArray ¶
func UnmarshalJsonObject ¶
Types ¶
This section is empty.