diff --git a/src/cli/cli.go b/src/cli/cli.go index a373dea..34f3d77 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -9,12 +9,12 @@ import ( "os" ) -func Parse_cli_args() (models.Forcing_params, error) { - var params models.Forcing_params +func ParseCliArgs() (models.ForcingParams, error) { + var params models.ForcingParams - UrlError := errors.New("No url given") - ThreadsError := errors.New("Wrong number of threads given") - WordListError := errors.New("No wordlist given") + UrlError := errors.New("no url given") + ThreadsError := errors.New("wrong number of threads given") + WordListError := errors.New("no wordlist given") forkptr := flag.Bool("v", false, "Verbose program") statusPtr := flag.String("status-codes", "200,401,403,404,429,500", "Comma-separated list of status codes to match") diff --git a/src/main.go b/src/main.go index 9642a22..5441b4f 100644 --- a/src/main.go +++ b/src/main.go @@ -8,12 +8,12 @@ import ( func main() { - forcing_params, err := cli.Parse_cli_args() + forcingParams, err := cli.ParseCliArgs() if err != nil { panic(err) } - fmt.Println(forcing_params) + fmt.Println(forcingParams) - query.MainRequest(&forcing_params) + query.MainRequest(&forcingParams) } diff --git a/src/models/models.go b/src/models/models.go index e496d22..1e8ea73 100644 --- a/src/models/models.go +++ b/src/models/models.go @@ -10,7 +10,7 @@ type MatchCriteria struct { BodyContains string } -type Forcing_params struct { +type ForcingParams struct { Workers int Url string Wordlist string diff --git a/src/query/callWorker.go b/src/query/callWorker.go index 983f0df..56332b9 100644 --- a/src/query/callWorker.go +++ b/src/query/callWorker.go @@ -6,14 +6,14 @@ import ( "sync" ) -func executeQueryFromFile(wg *sync.WaitGroup, params *models.Forcing_params, currentPath chan string) { +func executeQueryFromFile(wg *sync.WaitGroup, params *models.ForcingParams, currentPath chan string) { defer wg.Done() for taskData := range currentPath { QueryExecute(params, taskData, "GET") } } -func MainRequest(params *models.Forcing_params) { +func MainRequest(params *models.ForcingParams) { wg := &sync.WaitGroup{} wg.Add(params.Workers) channel := make(chan string) diff --git a/src/query/queryExecute.go b/src/query/queryExecute.go index 9f8bcc4..ca69493 100644 --- a/src/query/queryExecute.go +++ b/src/query/queryExecute.go @@ -9,7 +9,7 @@ import ( "net/http" ) -func QueryExecute(params *models.Forcing_params, path string, method string) { +func QueryExecute(params *models.ForcingParams, path string, method string) { client := &http.Client{} req, err := http.NewRequest(method, params.Url+path, nil) if err != nil {