helper

package
v5.0.0-alpha3+incompat... Latest Latest
Warning

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

Go to latest
Published: May 31, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

The conversion functions take a key and a map[string]string. First it checks if the key exists and logs and error if this is not the case. Second the conversion to the type is done. In case of an error and error is logged and the default values is returned. This guarantees that also if a field is missing or is not defined, still the full metricset is returned.

Package helper contains helper functions to make it simpler to perform common tasks and implement common features in Modules and MetricSets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToBool

func ToBool(key string, data map[string]string) bool

ToBool converts value to bool. In case of error, returns false

func ToFloat

func ToFloat(key string, data map[string]string) float64

ToFloat converts value to float64. In case of error, returns 0.0

func ToInt

func ToInt(key string, data map[string]string) int64

ToInt converts value to int. In case of error, returns 0

func ToStr

func ToStr(key string, data map[string]string) string

ToStr converts value to str. In case of error, returns ""

Types

This section is empty.

Jump to

Keyboard shortcuts

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