util

package
v0.0.0-...-bcce8f3 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayContains

func ArrayContains(array []string, value string) bool

func Base64Decode

func Base64Decode(toDecode string) string

func CurrentExecutableDir

func CurrentExecutableDir() string

func FileExists

func FileExists(filePath string) bool

func GetGcpKeyFilePath

func GetGcpKeyFilePath(p string) string

func GetHomeDir

func GetHomeDir() string

func GetJsonArray

func GetJsonArray(jsonMap interface{}, arrayKey string) []interface{}

func GetJsonObject

func GetJsonObject(jsonMap interface{}, key string) interface{}

func GetStringValue

func GetStringValue(jsonMap interface{}, key string) string

func LookupPathFor

func LookupPathFor(executable string) (string, error)

func ParseArray

func ParseArray(jsonString string) []map[string]interface{}

func ReadFileToBytes

func ReadFileToBytes(filename string) ([]byte, error)

func ReadFileToString

func ReadFileToString(filename string) (string, error)

func StringTemplateToArgsArray

func StringTemplateToArgsArray(templatedArgs string, values ...string) []string

StringTemplateToArgsArray spreads an array of values on top of a templated string (%s,%s,...). It receives a templated string (%s, %d, ...) and a spread of values ['a','b','c'] to generate a string

func WriteAsYaml

func WriteAsYaml(yamlFilePath string, values []string) string

Writes the array given to a yaml file at 'yamlFilePath'

func WriteStringToFile

func WriteStringToFile(content string, filePath string) error

Writes content to a filePath, overriding the current contents Returns: error when cannot create the file or write content

Types

type ExternalIpList

type ExternalIpList struct {
	ExternalIPs []string
}

type JSON

type JSON map[string]interface{}

Jump to

Keyboard shortcuts

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