Sample script to request test

Multiple request test script

This script running in GO if not have compiler execute this:

*** Open url: https://go.dev/dl/ download GO to your OS ***

Linux

$ tar -xzf downloadfile.tar && mv go /usr/local/
# Open with your editor ~/.profile or your path variable ambience example:
$ vim ~/.profile
#add export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:/usr/local/go/bin
$ source ~/.profile

#execute test
$ go version
# output: go version go1.14.2 linux/amd64

Now change file data.csv with you paylod

column 1 | column 2 | column 3

If your payload have more or less column, it will be necessary to change script

//Change this conditions to switch case
for j, field := range line {
    if j == 0 {
        rec.column1 = field
    } else if j == 1 {
        rec.column2 = field
    } else {
        rec.column3 = field
    }
}

//update all data struct 
type Data struct {
    Data  []DataInfo 
}

type DataInfo struct {
	column1 string
	column2 string
	column3 string
}

//Change this data structure
column1 := requestList[i].column1
column2 := requestList[i].column2
column3, _ := strconv.Atoi(requestList[i].column3) //if your column3 is integer

stringTest := fmt.Sprintf(`{"data": {
  "column1": "%s",
  "column2": "%s",
  "column3": %d
}}`, column1, column2, column3)

Add URL, Username and Password

const username = "username"
const password = "password"
const url = "http://localhost"

After install and updated running script

$ go build test.go
$ go run test.go
Owner
Gabriel Piassa
決めるのは我だ。
Gabriel Piassa
Similar Resources

Validate Golang request data with simple rules. Highly inspired by Laravel's request validation.

Validate Golang request data with simple rules. Highly inspired by Laravel's request validation.

Validate golang request data with simple rules. Highly inspired by Laravel's request validation. Installation Install the package using $ go get githu

Dec 29, 2022

github-actions-merger is github actions that merges pull request with commit message including pull request labels.

github-actions-merger github-actions-merger is github actions that merges pull request with commit message including pull request labels. Usage Write

Dec 7, 2022

Add request id to a request's context

RequestID 🔎 This is a very simple piece of middleware for adding request/correlation IDs to the context of a http request. By default, this module wi

Dec 4, 2021

Request: a HTTP request library for Go with interfaces and mocks for unit tests

Requester Request is a HTTP request library for Go with interfaces and mocks for

Jan 10, 2022

Goget will send a http request, and show the request time, status, response, and save response to a file

Goget will send a http request, and show the request time, status, response, and save response to a file

Feb 9, 2022

sample-go-test-app-vaibhav is a simple example of a production ready RPC service in Go

sample-go-test-app-vaibhav sample-go-test-app-vaibhav is a simple example of a production ready RPC service in Go. Instead of attempting to abstract a

Dec 2, 2021

A sample url shortener app to test Keploy integration capabilities

A sample url shortener app to test Keploy integration capabilities

Example URL Shortener A sample url shortener app to test Keploy integration capabilities Installation git clone https://github.com/keploy/example-url-

Oct 22, 2022

'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.

'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.

gotestsum gotestsum runs tests using go test --json, prints formatted test output, and a summary of the test run. It is designed to work well for both

Dec 28, 2022

octocov is a tool for collecting code metrics (code coverage, code to test ratio and test execution time).

octocov is a tool for collecting code metrics (code coverage, code to test ratio and test execution time).

Jan 9, 2023

go-test-trace is like go test but it also generates distributed traces.

go-test-trace is like go test but it also generates distributed traces.

go-test-trace go-test-trace is like go test but it also generates distributed traces. Generated traces are exported in OTLP to a OpenTelemetry collect

Jan 5, 2023

tfacon is a CLI tool for connecting Test Management Platforms and Test Failure Analysis Classifier.

Test Failure Classifier Connector Description tfacon is a CLI tool for connecting Test Management Platforms and Test Failure Analysis Classifier. Test

Jun 23, 2022

Flugel Test Documentation for steps to run and test the automatio

Flugel Test Documentation for steps to run and test the automatio

Flugel Test Documentation Documentation for steps to run and test the automation #Test-01 1 - Local Test Using Terratest (End To End) 1- By runing " t

Nov 13, 2022

A test repo to demonstrate the current (go1.17.2) issue when trying to use retractA test repo to demonstrate the current (go1.17.2) issue when trying to use retract

test-go-mod-retract This is a test repo to demonstrate the current (go1.17.2) issue when trying to use retract in go.mod to retract a version in a non

Oct 16, 2021

A best practices Go source project with unit-test and integration test, also use skaffold & helm to automate CI & CD at local to optimize development cycle

Dependencies Docker Go 1.17 MySQL 8.0.25 Bootstrap Run chmod +x start.sh if start.sh script does not have privileged to run Run ./start.sh --bootstrap

Apr 4, 2022

Test-assignment - Test assignment with golang

Test-assignment - Test assignment with golang

test-assignment We have a two steam of data and we need to save it in the map: I

Jan 19, 2022

Test-swaggo - Test swaggo with redis

Requirements Go 1.16 MySql Redis Development Install Dependencies go mod downloa

Jan 29, 2022

This repository includes consumer driven contract test for provider, unit test and counter api.

This repository includes consumer driven contract test for provider, unit test and counter api.

Feb 1, 2022
A fantastic HTTP request libarary used in Golang.

goz A fantastic HTTP request library used in golang. Inspired by guzzle Installation go get -u github.com/idoubi/goz Documentation API documentation

Dec 21, 2022
Simple web-hook based receiver executing things via HTTP request

Updater is a simple web-hook-based receiver executing things via HTTP requests and invoking remote updates without exposing any sensitive info, like ssh keys, passwords, etc.

Dec 19, 2022
httpreq is an http request library written with Golang to make requests and handle responses easily.

httpreq is an http request library written with Golang to make requests and handle responses easily. Install go get github.com/binalyze/http

Feb 10, 2022
A golang tool which makes http requests and prints the address of the request along with the MD5 hash of the response.

Golang Tool This repository is a golang tool which makes http requests to the external server and prints the address of the request along with the MD5

Oct 17, 2021
Docker-Project - A simplified backend that listens to POST request

This is a simplified backend that listens to POST request. Once it receives such a request it will push it to a PostgreSQL database.

Feb 5, 2022
Test-app-url-shortner - A sample url shortener app to test Keploy integration capabilities
Test-app-url-shortner - A sample url shortener app to test Keploy integration capabilities

test-app-url-shortner A sample url shortener app to test Keploy integration capa

Jan 23, 2022
Feb 10, 2022
Elastic Stack Docker + Sample Go AppElastic Stack Docker + Sample Go App
Elastic Stack Docker + Sample Go AppElastic Stack Docker + Sample Go App

?? Elastic Stack Docker + Sample Go App Test Elastic Stack which includes Elasticsearch, Kibana, Filebeat and Metricbeat. It comes with a very simple

Jan 14, 2022
EdgeDB-Golang-Docker-Sample - The sample of connection between EdgeDB Server and Go Echo API Server

EdgeDB Golang Docker Sample 『Go + Docker Composeを使ってEdgeDBを動かしてみた』のサンプルコードです。 使い

Nov 2, 2022
Sample code snippet to familiarize golang . Concept of goroutines , channels, concurrency is implemented in a sample scenario

go-mysql-goroutines-channel Sample code snippet to familiarize golang . Concept of goroutines , channels, concurrency , interface, slice, error handli

May 29, 2022