utils

package
v0.0.0-...-51afa80 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsciiToChar

func AsciiToChar(start int, end int) []string

function to convert ascii to character

func CheckErr

func CheckErr(e error, errMsg ...interface{})

function to check for error

func DirExists

func DirExists(path string) bool

function to check if directory exists?

func FileExists

func FileExists(path string) bool

function to check if file exists?

func MakeNumList

func MakeNumList(start int, end int) []string

Takes two integer as input and returns list of numbers from first arg -> second arg

func MakeRequest

func MakeRequest(method, url string, customTransport *http.Transport, t, rt int, out chan []string, wg *sync.WaitGroup)

make concurrent requests

func ShowDebug

func ShowDebug(msg ...string)

func ShowError

func ShowError(msg ...interface{})

func ShowInfo

func ShowInfo(msg ...string)

func ShowSuccess

func ShowSuccess(msg ...interface{})

func ShowWarning

func ShowWarning(msg ...interface{})

func ToInt

func ToInt(s string) (bool, int)

Takes a number as input in string format. Ex: "1","2" throws error if arg is not a number in string form returns a bool value (true if input is a char, false if everything ok) and input in integer

func WriteFile

func WriteFile(filePath string, fileData string)

TODO: find alternative for text template, use struct or something function to write data to file only for text files

Types

type JsonExportTemplate

type JsonExportTemplate struct {
	Export string              `json:"export_type"`
	Method string              `json:"method"`
	Target string              `json:"target"`
	Date   string              `json:"date_time"`
	Result map[string][]string `json:"result"`
}

for json export rename the members

func (JsonExportTemplate) WriteJson

func (j JsonExportTemplate) WriteJson(filePath string)

Jump to

Keyboard shortcuts

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