formatter

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

README

formatter

-- import "github.com/newrelic/nri-flex/internal/formatter"

Usage

func KvFinder
func KvFinder(mode string, k1 string, k2 string) bool

KvFinder tests with multiple modes, whether k1 satisfies k2

func PercToDecimal
func PercToDecimal(v *interface{})

PercToDecimal convert percentage to decimal

func RegMatch
func RegMatch(text string, regexmatch string) []string

RegMatch Perform regex matching

func RegSplit
func RegSplit(text string, delimiter string) []string

RegSplit Split by Regex

func SnakeCaseToCamelCase
func SnakeCaseToCamelCase(key *string)

SnakeCaseToCamelCase converts snake_case to camelCase

func SplitKey
func SplitKey(key, splitChar string) (string, string, bool)

SplitKey simple key value pair splitter

func ValueParse
func ValueParse(v interface{}, regex string) string

ValueParse Plucks first found value out with regex, if nothing found send back the value

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KvFinder

func KvFinder(mode string, k1 string, k2 string) bool

KvFinder tests with multiple modes, whether k1 satisfies k2

func PercToDecimal

func PercToDecimal(v *interface{})

PercToDecimal convert percentage to decimal

func RegMatch

func RegMatch(text string, regexmatch string) []string

RegMatch Perform regex matching

func RegSplit

func RegSplit(text string, delimiter string) []string

RegSplit Split by Regex

func SnakeCaseToCamelCase

func SnakeCaseToCamelCase(key *string)

SnakeCaseToCamelCase converts snake_case to camelCase

func SplitKey

func SplitKey(key, splitChar string) (string, string, bool)

SplitKey simple key value pair splitter

func ValueParse

func ValueParse(v interface{}, regex string) string

ValueParse Plucks first found value out with regex, if nothing found send back the value

Types

This section is empty.

Jump to

Keyboard shortcuts

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