utils

package
v0.0.0-...-2987df4 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffKeyValuesInMap

func DiffKeyValuesInMap(X, Y map[string]string) map[string]string

DiffKeyValuesInMap does a diff key and values from 2 strings maps

func DiffSlice

func DiffSlice(X, Y []string) []string

DiffSlice return de Difference between two Slices

func GetTLSConfig

func GetTLSConfig(
	SSLCert, SSLKey, SSLCA string,
	InsecureSkipVerify bool,
) (*tls.Config, error)

GetTLSConfig gets a tls.Config object from the given certs, key, and CA files. you must give the full path to the files. If all files are blank and InsecureSkipVerify=false, returns a nil pointer.

func Grep

func Grep(lines []string, reg *regexp.Regexp) (inc []string, notinc []string)

Grep return includes and not included array

func KeyValArrayToMap

func KeyValArrayToMap(keyvalar []string) (map[string]string, error)

KeyValArrayToMap return a map from a key value array

func MapAdd

func MapAdd(dest map[string]string, orig map[string]string)

MapAdd Add map to devices

func MapDupAndAdd

func MapDupAndAdd(source, add map[string]string) map[string]string

MapDupAndAdd duplicate map and also add new values

func RemoveDuplicatesUnordered

func RemoveDuplicatesUnordered(elements []string) []string

RemoveDuplicatesUnordered removes duplicated elements in the array string

func StrArrayAppendIfMissing

func StrArrayAppendIfMissing(slice []string, i string) []string

StrArrayAppendIfMissing create a new array with data appended if not exist

func WaitAlignForNextCycle

func WaitAlignForNextCycle(SecPeriod int, l *logrus.Logger)

WaitAlignForNextCycle waiths untile a next cycle begins aligned with second 00 of each minute

Types

This section is empty.

Jump to

Keyboard shortcuts

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