Skip to content

Commit

Permalink
feat: updated main readme and user-profile readme (#78)
Browse files Browse the repository at this point in the history
* feat: main readme updated

Signed-off-by: Animesh <[email protected]>

* feat: users-profile readme updated

Signed-off-by: Animesh <[email protected]>

---------

Signed-off-by: Animesh Pathak <[email protected]>
Signed-off-by: Animesh <[email protected]>
Co-authored-by: Animesh Pathak <[email protected]>
  • Loading branch information
Sonichigo and Animesh Pathak authored Oct 25, 2023
1 parent 2912ff4 commit 81d4646
Show file tree
Hide file tree
Showing 12 changed files with 291 additions and 94 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/keploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: e2e Tests
on:
push:
branches:
- main
jobs:
e2e-test:
runs-on: ubuntu-latest
steps:
- name: Test-Report
uses: alphasians/test-reportql@main
with:
working-directory: "./gin-mongo"
delay: 20
42 changes: 20 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 align="center"> Keploy Go SDK Samples </h1>
<h1 align="center"> Keploy Go Samples Apps </h1>
<p align="center">

<a href="CODE_OF_CONDUCT.md" alt="Contributions welcome">
Expand All @@ -14,33 +14,31 @@ This repo contains the sample for [Keploy's](https://keploy.io) Go SDK. Please f

**Note** :- Issue Creation is disabled on this Repository, please visit [here](https://github.com/keploy/keploy/issues/new/choose) to submit Issue.

# Keploy Go SDK Samples
This repo contains the sample for [Keploy's](https://keploy.io) Go SDK. Please feel free to contribute if you'd like submit a sample for another use-case or library.
# Keploy Go Samples
This repo contains the sample for [Keploy's](https://keploy.io)🐰 with Golang. Please feel free to contribute if you'd like submit a sample for another use-case or library.

## Quick Start
The fastest way to start with Keploy is the Gitpod-hosted version. When you're ready, you can install locally or host yourself.

One-click deploy sample URL Shortener application sample with Keploy using Gitpod
## Go Sample Apps with Keploy

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer)
1. [Echo-SQL](https://github.com/keploy/samples-go/tree/main/echo-sql) 🚀
2. [Gin-Mongo](https://github.com/keploy/samples-go/tree/main/gin-mongo) 🌟
3. [GraphQL-SQL](https://github.com/keploy/samples-go/tree/main/graphql-sql) 💻
4. [Mux-SQL](https://github.com/keploy/samples-go/tree/main/mux-sql) 🛠️
5. [Users-Profile](https://github.com/keploy/samples-go/tree/main/users-profile) 👨‍💻

Then, continue with [Generating Test Cases](https://github.com/keploy/samples-go/tree/main/echo-sql#generate-shortned-url)

## Sample Apps with Keploy GO SDK
## Community Support ❤️

1. [Echo-SQL](https://github.com/keploy/samples-go/tree/main/echo-sql)
2. [Gin-Mongo](https://github.com/keploy/samples-go/tree/main/gin-mongo)
3. [Gin-Elastic](https://github.com/keploy/samples-go/tree/main/gin-elastic)
### 🤔 Questions?
Reach out to us. We're here to help!

[//]: # (3. [Users-Profile]&#40;https://github.com/keploy/samples-go/tree/main/users-profile&#41;)
[![Slack](https://img.shields.io/badge/Slack-4A154B?style=for-the-badge&logo=slack&logoColor=white)](https://join.slack.com/t/keploy/shared_invite/zt-12rfbvc01-o54cOG0X1G6eVJTuI_orSA)
[![LinkedIn](https://img.shields.io/badge/linkedin-%230077B5.svg?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/company/keploy/)
[![YouTube](https://img.shields.io/badge/YouTube-%23FF0000.svg?style=for-the-badge&logo=YouTube&logoColor=white)](https://www.youtube.com/channel/UC6OTg7F4o0WkmNtSoob34lg)
[![Twitter](https://img.shields.io/badge/Twitter-%231DA1F2.svg?style=for-the-badge&logo=Twitter&logoColor=white)](https://twitter.com/Keployio)

## Community Support ❤️
### 💖 Let's Build Together!
Whether you're a newbie coder or a wizard 🧙‍♀️, your perspective is golden. Take a peek at our:

We'd love to collaborate with you to make Keploy great. To get started:
* [Slack](https://join.slack.com/t/keploy/shared_invite/zt-12rfbvc01-o54cOG0X1G6eVJTuI_orSA) - Discussions with the community and the team.
* [GitHub](https://github.com/keploy/keploy/issues) - For bug reports and feature requests.
📜 [Contribution Guidelines](https://github.com/keploy/keploy/blob/main/CONTRIBUTING.md)

[![Generic badge](https://img.shields.io/badge/Slack-teal.svg?style=for-the-badge)](https://join.slack.com/t/keploy/shared_invite/zt-12rfbvc01-o54cOG0X1G6eVJTuI_orSA)
[![Generic badge](https://img.shields.io/badge/LinkedIn-blue.svg?style=for-the-badge)](https://www.linkedin.com/company/keploy/)
[![Generic badge](https://img.shields.io/badge/Youtube-teal.svg?style=for-the-badge)](https://www.youtube.com/channel/UC6OTg7F4o0WkmNtSoob34lg)
[![Generic badge](https://img.shields.io/badge/Twitter-blue.svg?style=for-the-badge)](https://twitter.com/Keployio)
❤️ [Code of Conduct](https://github.com/keploy/keploy/blob/main/CODE_OF_CONDUCT.md)
3 changes: 1 addition & 2 deletions gin-mongo/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
test-app-url-shortener
keploy/
test-app-url-shortener
5 changes: 3 additions & 2 deletions gin-mongo/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ services:
ports:
- "27017:27017"
networks:
- keploy-network
- keploy-network

networks:
keploy-network:
keploy-network:
external: true
135 changes: 135 additions & 0 deletions gin-mongo/keploy/test-set-0/mocks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
version: api.keploy.io/v1beta2
kind: Mongo
name: mocks
spec:
metadata:
operation: '{ OpQuery flags: [SecondaryOK], fullCollectionName: admin.$cmd, numberToSkip: 0, numberToReturn: -1, query: {"isMaster": {"$numberInt":"1"},"helloOk": true,"compression": [],"client": {"driver": {"name": "mongo-go-driver","version": "v1.8.1"},"os": {"type": "linux","architecture": "arm64"},"platform": "go1.20.8"}}, returnFieldsSelector: }'
type: config
requests:
- header:
length: 230
requestId: 1
responseTo: 0
Opcode: 2004
message:
flags: 4
collection_name: admin.$cmd
number_to_skip: 0
number_to_return: -1
query: '{"isMaster":{"$numberInt":"1"},"helloOk":true,"compression":[],"client":{"driver":{"name":"mongo-go-driver","version":"v1.8.1"},"os":{"type":"linux","architecture":"arm64"},"platform":"go1.20.8"}}'
return_fields_selector: ""
read_delay: 11417
responses:
- header:
length: 329
requestId: 3
responseTo: 1
Opcode: 1
message:
response_flags: 8
cursor_id: 0
starting_from: 0
number_returned: 1
documents:
- '{"helloOk":true,"ismaster":true,"topologyVersion":{"processId":{"$oid":"651e8929aee8d38d01a09188"},"counter":{"$numberLong":"0"}},"maxBsonObjectSize":{"$numberInt":"16777216"},"maxMessageSizeBytes":{"$numberInt":"48000000"},"maxWriteBatchSize":{"$numberInt":"100000"},"localTime":{"$date":{"$numberLong":"1696500034998"}},"logicalSessionTimeoutMinutes":{"$numberInt":"30"},"connectionId":{"$numberInt":"1"},"minWireVersion":{"$numberInt":"0"},"maxWireVersion":{"$numberInt":"17"},"readOnly":false,"ok":{"$numberDouble":"1.0"}}'
read_delay: 1512792
created: 1696500035
---
version: api.keploy.io/v1beta2
kind: Mongo
name: mocks
spec:
metadata:
operation: '{ OpMsg flags: 0, sections: [{ SectionSingle msg: {"update":"url-shortener","ordered":true,"writeConcern":{"w":"majority"},"lsid":{"id":{"$binary":{"base64":"FxKEjEbCSYqImwxjboBvEg==","subType":"04"}}},"$db":"keploy"} }, { SectionSingle identifier: updates , msgs: [ {"q":{"_id":"Lhr4BWAi"},"u":{"$set":{"_id":"Lhr4BWAi","created":{"$date":{"$numberLong":"1696500033094"}},"updated":{"$date":{"$numberLong":"1696500033094"}},"url":"https://google.com"}},"upsert":true} ] }], checksum: 0 }'
requests:
- header:
length: 301
requestId: 5
responseTo: 0
Opcode: 2013
message:
flagBits: 0
sections:
- '{ SectionSingle msg: {"update":"url-shortener","ordered":true,"writeConcern":{"w":"majority"},"lsid":{"id":{"$binary":{"base64":"FxKEjEbCSYqImwxjboBvEg==","subType":"04"}}},"$db":"keploy"} }'
- '{ SectionSingle identifier: updates , msgs: [ {"q":{"_id":"Lhr4BWAi"},"u":{"$set":{"_id":"Lhr4BWAi","created":{"$date":{"$numberLong":"1696500033094"}},"updated":{"$date":{"$numberLong":"1696500033094"}},"url":"https://google.com"}},"upsert":true} ] }'
checksum: 0
read_delay: 151375
responses:
- header:
length: 112
requestId: 6
responseTo: 5
Opcode: 2013
message:
flagBits: 0
sections:
- '{ SectionSingle msg: {"n":{"$numberInt":"1"},"upserted":[{"index":{"$numberInt":"0"},"_id":"Lhr4BWAi"}],"nModified":{"$numberInt":"0"},"ok":{"$numberDouble":"1.0"}} }'
checksum: 0
read_delay: 24970583
created: 1696500035
---
version: api.keploy.io/v1beta2
kind: Mongo
name: mocks
spec:
metadata:
operation: '{ OpMsg flags: 0, sections: [{ SectionSingle msg: {"hello":{"$numberInt":"1"},"helloOk":true,"$db":"admin"} }], checksum: 0 }'
type: config
requests:
- header:
length: 62
requestId: 6
responseTo: 0
Opcode: 2013
message:
flagBits: 0
sections:
- '{ SectionSingle msg: {"hello":{"$numberInt":"1"},"helloOk":true,"$db":"admin"} }'
checksum: 0
read_delay: 9989556629
responses:
- header:
length: 323
requestId: 7
responseTo: 6
Opcode: 2013
message:
flagBits: 0
sections:
- '{ SectionSingle msg: {"helloOk":true,"isWritablePrimary":true,"topologyVersion":{"processId":{"$oid":"651e8929aee8d38d01a09188"},"counter":{"$numberLong":"0"}},"maxBsonObjectSize":{"$numberInt":"16777216"},"maxMessageSizeBytes":{"$numberInt":"48000000"},"maxWriteBatchSize":{"$numberInt":"100000"},"localTime":{"$date":{"$numberLong":"1696500044994"}},"logicalSessionTimeoutMinutes":{"$numberInt":"30"},"connectionId":{"$numberInt":"2"},"minWireVersion":{"$numberInt":"0"},"maxWireVersion":{"$numberInt":"17"},"readOnly":false,"ok":{"$numberDouble":"1.0"}} }'
checksum: 0
read_delay: 710500
created: 1696500044
---
version: api.keploy.io/v1beta2
kind: Mongo
name: mocks
spec:
metadata:
operation: '{ OpMsg flags: 65536, sections: [{ SectionSingle msg: {"hello":{"$numberInt":"1"},"helloOk":true,"topologyVersion":{"processId":{"$oid":"651e8929aee8d38d01a09188"},"counter":{"$numberLong":"0"}},"maxAwaitTimeMS":{"$numberLong":"10000"},"$db":"admin"} }], checksum: 0 }'
type: config
requests:
- header:
length: 148
requestId: 3
responseTo: 0
Opcode: 2013
message:
flagBits: 65536
sections:
- '{ SectionSingle msg: {"hello":{"$numberInt":"1"},"helloOk":true,"topologyVersion":{"processId":{"$oid":"651e8929aee8d38d01a09188"},"counter":{"$numberLong":"0"}},"maxAwaitTimeMS":{"$numberLong":"10000"},"$db":"admin"} }'
checksum: 0
read_delay: 20000
responses:
- header:
length: 323
requestId: 8
responseTo: 3
Opcode: 2013
message:
flagBits: 2
sections:
- '{ SectionSingle msg: {"helloOk":true,"isWritablePrimary":true,"topologyVersion":{"processId":{"$oid":"651e8929aee8d38d01a09188"},"counter":{"$numberLong":"0"}},"maxBsonObjectSize":{"$numberInt":"16777216"},"maxMessageSizeBytes":{"$numberInt":"48000000"},"maxWriteBatchSize":{"$numberInt":"100000"},"localTime":{"$date":{"$numberLong":"1696500045004"}},"logicalSessionTimeoutMinutes":{"$numberInt":"30"},"connectionId":{"$numberInt":"1"},"minWireVersion":{"$numberInt":"0"},"maxWireVersion":{"$numberInt":"17"},"readOnly":false,"ok":{"$numberDouble":"1.0"}} }'
checksum: 0
read_delay: 10004565546
created: 1696500045
37 changes: 37 additions & 0 deletions gin-mongo/keploy/test-set-0/tests/test-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: api.keploy.io/v1beta2
kind: Http
name: test-1
spec:
metadata: {}
req:
method: POST
proto_major: 1
proto_minor: 1
url: http://localhost:8080/url
header:
Accept: '*/*'
Content-Length: "33"
Content-Type: application/json
Host: localhost:8080
User-Agent: curl/8.1.2
body: |-
{
"url": "https://google.com"
}
body_type: ""
resp:
status_code: 200
header:
Content-Length: "65"
Content-Type: application/json; charset=utf-8
Date: Thu, 05 Oct 2023 10:00:35 GMT
body: '{"ts":1696500035031769854,"url":"http://localhost:8080/Lhr4BWAi"}'
body_type: ""
status_message: ""
proto_major: 0
proto_minor: 0
objects: []
assertions:
noise:
- header.Date
created: 1696500039
2 changes: 1 addition & 1 deletion users-profile/.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MONGO-DB-URI="mongodb://localhost:27017"
MONGO-DB-URI="mongodb://mongoDb:27017"
17 changes: 17 additions & 0 deletions users-profile/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Use an official Golang runtime as a parent image
FROM golang:1.20-bookworm

# Set the working directory inside the container
WORKDIR /app

# Copy the local package files to the container's workspace
COPY . .

# Build the Go application
RUN go build -o main .

# Expose port 8080
EXPOSE 8080

# Command to run the Go application
CMD ["./main"]
Loading

0 comments on commit 81d4646

Please sign in to comment.