Skip to content

Commit

Permalink
Merge pull request #96 from keploy/shivam/docs
Browse files Browse the repository at this point in the history
refactor:more focus on host change
  • Loading branch information
Sonichigo authored Jan 26, 2024
2 parents dec1079 + 5d7811c commit 2f66c83
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
4 changes: 2 additions & 2 deletions echo-sql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ docker network create keploy-network
```


### Capture the Testcases
### Update the Host

> **Since, we are on the local machine the Postgres Host will be `localhost`.**
> **Since we have setup our sample-app natively, we need to update the Postgres host on line 27, in `main.go`, from `postgresDb` to `localhost`.**
### Capture the testcases

Expand Down
1 change: 1 addition & 0 deletions echo-sql/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func main() {

Database, err = NewConnection(ConnectionDetails{
host: "postgresDb",
// host: "localhost" when using natively
//host: "echo-sql-postgres-1",
port: "5432",
user: "postgres",
Expand Down
2 changes: 2 additions & 0 deletions gin-mongo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ Spin up your mongo container using
sudo docker run --rm -p27017:27017 -d --network keploy-network --name mongoDb mongo
```

### Update the Host

> **Since, we are on the local machine the MongoDB URL will be `localhost:27017`. This needs to be updated on the on line 21 in `main.go` file**
### Capture the testcases
Expand Down
8 changes: 4 additions & 4 deletions gin-mongo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ func main() {
if err != nil {
logger.Fatal("failed to create mgo db client", zap.Error(err))
}
db := client.Database(dbName)
db :=client.Database(dbName)

col = db.Collection(collection)
col =db.Collection(collection)

port := "8080"

Expand All @@ -50,7 +50,7 @@ func main() {
go func() {
select {
case <-stopper:
ctx, cancel := context.WithTimeout(context.Background(), 5 * time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
if err := srv.Shutdown(ctx); err != nil {
logger.Fatal("Server Shutdown:", zap.Error(err))
Expand All @@ -63,4 +63,4 @@ func main() {
logger.Fatal("listen: %s\n", zap.Error(err))
}
logger.Info("server exiting")
}
}
2 changes: 2 additions & 0 deletions gin-redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ We need create an alias for Keploy:
alias keploy='sudo docker run --pull always --name keploy-v2 -p 16789:16789 --privileged --pid=host -it -v "$(pwd)":/files -v /sys/fs/cgroup:/sys/fs/cgroup -v /sys/kernel/debug:/sys/kernel/debug -v /sys/fs/bpf:/sys/fs/bpf -v /var/run/docker.sock:/var/run/docker.sock -v '"$HOME"'/.keploy-config:/root/.keploy-config -v '"$HOME"'/keploy-config:/root/keploy-config --rm ghcr.io/keploy/keploy'
```

### Update the Host

> **Since, we are on the docker image the Redis URL will be myredis:6379 instead of localhost:6379. This needs to be updated in `helpers/redis/redisConnect.go` file**
### Create a Docker network
Expand Down
5 changes: 3 additions & 2 deletions graphql-sql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ Using the docker-compose file we will start our postgres instance:-
# Start Postgres
docker-compose up -d
```
### Capture the Testcases

> **Since, we are on the local machine the Postgres Host will be `localhost`.**
### Update the Host

> **Since we have setup our sample-app natively, we need to set the Postgres host on line 18, in `main.go` to `localhost`.**
### Capture the testcases

Expand Down
7 changes: 5 additions & 2 deletions mux-sql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ Using the docker-compose file we will start our postgres instance:-
# Start Postgres
docker-compose up -d
```
### Capture the Testcases

> **Since, we are on the local machine the Postgres Host will be `localhost`.**
### Update the Host

> **Since we have setup our sample-app natively set the host to `localhost` on line 10.**
### Capture the Testcases

Now, we will create the binary of our application:-

Expand Down

0 comments on commit 2f66c83

Please sign in to comment.