File tree Expand file tree Collapse file tree 9 files changed +143
-0
lines changed Expand file tree Collapse file tree 9 files changed +143
-0
lines changed Original file line number Diff line number Diff line change 1+ # GRPC Server Example
2+
3+ This GoFr example demonstrates a simple grpc server.
4+
5+ ### To run the example use the command below:
6+ ``` console
7+ go run main.go
8+ ```
Original file line number Diff line number Diff line change 1+ # Redis Example
2+
3+ This GoFr example demonstrates the use of redis as datasource through a simple http server.
4+
5+ ### To run the example follow the steps below:
6+
7+ - Run the docker image of redis
8+ ``` console
9+ docker run --name gofr-redis -p 2002:6379 -d redis:7.0.5
10+ ```
11+
12+ - Now run the example
13+ ``` console
14+ go run main.go
15+ ```
Original file line number Diff line number Diff line change 1+ # HTTP Server Example
2+
3+ This GoFr example demonstrates a simple http server which supports redis and mysql as datasources.
4+
5+ ### To run the example follow the steps below:
6+
7+ - Run the docker image of redis
8+ ``` console
9+ docker run --name gofr-redis -p 2002:6379 -d redis:7.0.5
10+ ```
11+
12+ - Run the docker image of mysql
13+ ``` console
14+ docker run --name gofr-mysql -e MYSQL_ROOT_PASSWORD=password -p 2001:3306 -d mysql:8.0.30
15+ ```
16+
17+ NOTE: Please create a DB named ` test ` as mentioned in ` DB_NAME ` using above mysql image.
18+
19+ - Now run the example
20+ ``` console
21+ go run main.go
22+ ```
Original file line number Diff line number Diff line change 1+ # CMD Example
2+
3+ This GoFr example demonstrates a simple CMD application.
4+
5+ ### To run the example use the command below:
6+ ``` console
7+ go run main.go
8+ ```
Original file line number Diff line number Diff line change 1+ # Custom Metrics Example
2+
3+ This GoFr example demonstrates the use of custom metrics through a simple http server that creates and populate metrics.
4+
5+ ### To run the example use the command below:
6+ ``` console
7+ go run main.go
8+ ```
Original file line number Diff line number Diff line change 1+ # Http-Service Example
2+
3+ This GoFr example demonstrates an inter-service http communication along with circuit-breaker as well as
4+ service health config addition.
5+
6+ User can use the ` AddHTTPService ` method to add an http service and then later get it using ` GetHTTPService("service-name") `
7+
8+ ### To run the example follow the below steps:
9+ - Make sure your other service and health endpoint is ready and up on the given address.
10+ - Now run the example using below command :
11+
12+ ``` console
13+ go run main.go
14+ ```
Original file line number Diff line number Diff line change 1+ # Migrations Example
2+
3+ This GoFr example demonstrates the use of ` migrations ` through a simple http server using mysql and redis.
4+
5+ ### To run the example follow the below steps:
6+ - Run the docker image of mysql and redis
7+
8+ ``` console
9+ docker run --name gofr-mysql -e MYSQL_ROOT_PASSWORD=password -p 2001:3306 -d mysql:8.0.30
10+ docker run --name gofr-redis -p 2002:6379 -d redis:7.0.5
11+ ```
12+
13+ - Now run the example using below command :
14+
15+ ``` console
16+ go run main.go
17+ ```
Original file line number Diff line number Diff line change 1+ # Publisher Example
2+
3+ This GoFr example demonstrates a simple Publisher that publishes to the given topic when an http request is made to it's
4+ matching route.
5+
6+ ### To run the example follow the below steps:
7+
8+ - Run the docker image of kafka and zookeeper and ensure that your provided topics are created before publishing
9+ ``` console
10+ docker run --rm -d -p 2181:2181 -p 443:2008 -p 2008:2008 -p 2009:2009 \
11+ --env ADVERTISED_LISTENERS=PLAINTEXT://localhost:443,INTERNAL://localhost:2009 \
12+ --env LISTENERS=PLAINTEXT://0.0.0.0:2008,INTERNAL://0.0.0.0:2009 \
13+ --env SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,INTERNAL:PLAINTEXT \
14+ --env INTER_BROKER=INTERNAL \
15+ --env KAFKA_CREATE_TOPICS="test-topic,test:36:1,krisgeus:12:1:compact" \
16+ --name gofr-kafka \
17+ krisgeus/docker-kafka
18+ ```
19+
20+ - Now run the example using below command :
21+
22+ ``` console
23+ go run main.go
24+ ```
25+
Original file line number Diff line number Diff line change 1+ # Subscriber Example
2+
3+ This GoFr example demonstrates a simple Subscriber that subscribes asynchronously to a given topic and commits based
4+ on the handler response.
5+
6+
7+ ### To run the example follow the below steps:
8+
9+ - Run the docker image of kafka and zookeeper and ensure that your provided topics are created before subscribing.
10+ ``` console
11+ docker run --rm -d -p 2181:2181 -p 443:2008 -p 2008:2008 -p 2009:2009 \
12+ --env ADVERTISED_LISTENERS=PLAINTEXT://localhost:443,INTERNAL://localhost:2009 \
13+ --env LISTENERS=PLAINTEXT://0.0.0.0:2008,INTERNAL://0.0.0.0:2009 \
14+ --env SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,INTERNAL:PLAINTEXT \
15+ --env INTER_BROKER=INTERNAL \
16+ --env KAFKA_CREATE_TOPICS="test-topic,test:36:1,krisgeus:12:1:compact" \
17+ --name gofr-kafka \
18+ krisgeus/docker-kafka
19+ ```
20+
21+ - Now run the example using below command :
22+
23+ ``` console
24+ go run main.go
25+ ```
26+
You can’t perform that action at this time.
0 commit comments