framework: github.com/openchirp/framework/utils Index | Files

package utils

import "github.com/openchirp/framework/utils"

Package utils holds common data structures and functions useful for working with OpenChirp.

Index

Package Files

importpath.go utils.go

func FormatFloat64 Uses

func FormatFloat64(f float64) string

FormatFloat64 formats the given float64 value using a dynamic precison that looks cleaner when sent back to OpenChirp

func ParseCSVConfig Uses

func ParseCSVConfig(configline string) ([]string, error)

ParseCSVConfig parses a single config field that follows comma and optional quotes seperated syntax into it's constituent tokens Possible errors returned are from the encoding/csv package. The error can be referenced by it's concrete type *csv.ParseError, which can give useful information about where the parse error occurred. Example: errColumn := err.(*csv.ParseError).Column

func ParseOCValue Uses

func ParseOCValue(value string) interface{}

ParseOCValue tries to parse the three typical primitive data types used in OpenChirp. It first tries to parse the value as a float64. Then, it tries to parse as a bool. If all else fails, it returns the value as a string.

Package utils imports 3 packages (graph) and is imported by 3 packages. Updated 2018-11-22. Refresh now. Tools for package owners.