utils

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToFile

func AppendToFile(data string, filePath string) error

* Takes data and writes it to a file

func CollectJsonKeys added in v0.3.0

func CollectJsonKeys(json map[string]interface{}, reqJsonKeys map[string]struct{}) map[string]struct{}

* Recursively collects keys from JSON object * Returns a collection of unique keys as map[string]struct{}

func DownloadFromURL added in v0.6.0

func DownloadFromURL(url *url.URL, folder string) error

* Download a file from a url into a folder

func FileExists

func FileExists(name string) bool

* Check if a file exists

func ReadLines

func ReadLines(path string) ([]string, error)

* Takes file path and returns lines

func SendSlackNotification added in v0.3.0

func SendSlackNotification(webhookUrl string, msg string) error

* Send a slack notification via webhook

func UnmarshalReqBody added in v0.3.0

func UnmarshalReqBody(reqBody string) (unmarshaled map[string]interface{}, err error)

* Unmarshal the request body

func WriteUniqueFile added in v0.3.0

func WriteUniqueFile(host string, checksum string, body string, outputDir string, httpDump string, ext string)

* Creates a uniquely named file and write http dump to it. * The file name represents a hashed host, path and request body. * This means that any request and it's resposne are named with the same hash. * This makes it easy to go through and read them, when opened with "vim *"

Types

This section is empty.

Jump to

Keyboard shortcuts

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