historianutils

package
v0.0.0-...-fd24290 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package historianutils is a library of common utility functions for Battery Historian processing.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ServiceDumpRE is a regular expression to match the beginning of a service dump.
	ServiceDumpRE = regexp.MustCompile(`^DUMP\s+OF\s+SERVICE\s+(?P<service>\S+):`)
)

Functions

func ErrorsToString

func ErrorsToString(errs []error) string

ErrorsToString converts an array of errors into a newline delimited string.

func GzipCompress

func GzipCompress(uncompressed []byte) ([]byte, error)

GzipCompress compresses byte data.

func RunCommand

func RunCommand(name string, args ...string) (string, error)

RunCommand executes the given command and returns the output.

func ScrubPII

func ScrubPII(input string) string

ScrubPII scrubs any part of the string that looks like PII (eg. an email address). From:

com.google.android.apps.plus.content.EsProvider/com.google/john.doe@gmail.com/extra
or
*sync*/com.app.android.conversations/com.app.android.account/Mr. Noogler

To:

com.google.android.apps.plus.content.EsProvider/com.google/XXX@gmail.com/extra
or
*sync*/com.app.android.conversations/com.app.android.account/XXX

func SubexpNames

func SubexpNames(r *regexp.Regexp, s string) (bool, map[string]string)

SubexpNames returns a mapping of the sub-expression names to values if the Regexp successfully matches the string, otherwise, it returns false.

Types

This section is empty.

Jump to

Keyboard shortcuts

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