util

package
v0.0.0-...-5cd0c88 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToAWS

func ConnectToAWS(awsAccessKeyId string, awsSecretAccessKey string, awsSessionToken string, awsRegion string) (*session.Session, error)

func CreateCipher

func CreateCipher(salt_string string, passphrase_string string) (cipher.Block, error)

CreateCipher returns a cipher.Block given a salt and passphrase

func DecryptBytes

func DecryptBytes(input []byte, passphrase string, salt string) ([]byte, error)

func DecryptReader

func DecryptReader(reader grw.ByteReadCloser, passphrase string, salt string) ([]byte, error)

func MergeConfig

func MergeConfig(v *viper.Viper, configUri string)

MergeConfig merges a config from the given uri into the Viper config.

func MergeConfigs

func MergeConfigs(v *viper.Viper, configUris []string)

MergeConfigs merges an array of config from the given uris into the Viper config.

func ParseDfl

func ParseDfl(dflUri string, dflExpression string) (dfl.Node, error)

func ProcessInput

func ProcessInput(inputBytes []byte, inputFormat string, inputHeader []string, inputComment string, inputLazyQuotes bool, inputSkipLines int, inputLimit int, dflExpression string, dflVars map[string]interface{}, dflUri string, outputFormat string, outputHeader []string, outputLimit int, verbose bool) (string, error)

func SplitNameFormatCompression

func SplitNameFormatCompression(p string) (string, string, string)

SplitNameFormatCompression splits a filename into it's basename, format, and compression.

  • *.json => ("*", "json", "") // JSON File
  • *.json.bz2 => ("*", "json", "bzip2") // bzip2-compressed JSON file
  • *.json.gz => ("*", "json", "gzip") // gzip-compressed JSON file
  • *.json.sz => ("*", "json", "snappy") // snappy-compressed JSON file
  • *.jsonl => ("*", "jsonl", "") // JSON Lines file
  • *.jsonl.bz2 => ("*", "jsonl", "bzip2") // bzip2-compressed JSON Lines file
  • *.jsonl.gz => ("*", "jsonl", "gzip") // gzip-compressed JSON Lines file
  • *.jsonl.sz => ("*", "jsonl", "snappy") // snappy-compressed JSON Lines file
  • *.yaml => ("*", "yaml", "") // YAML file
  • *.yaml.bz2 => ("*", "yaml", "bzip2") // bzip2-compressed YAML file
  • *.yaml.gz => ("*", "yaml", "gzip") // gzip-compressed YAML file
  • *.yaml.sz => ("*", "yaml", "snappy") // Snappy-compressed YAML file
  • *.hcl => ("*", "hcl", "") // HCL file
  • *.hcl.bz2 => ("*", "hcl", "bzip2") // bzip2-compressed HCL file
  • *.hcl.gz => ("*", "hcl", "gzip") // gzip-compressed HCL file
  • *.hcl.sz => ("*", "hcl", "snappy") // Snappy-compressed HCL file

Types

This section is empty.

Jump to

Keyboard shortcuts

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