Skip to content

Commit

Permalink
refactor(examples): use local modules
Browse files Browse the repository at this point in the history
  • Loading branch information
alebabai committed Feb 13, 2024
1 parent 50aa90b commit 5afbd45
Show file tree
Hide file tree
Showing 40 changed files with 243 additions and 165 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions _examples/common/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module github.com/alebabai/go-kit-kafka/examples/common

go 1.16

require (
github.com/alebabai/go-kit-kafka v0.0.0
github.com/go-kit/kit v0.13.0
github.com/go-kit/log v0.2.1
github.com/google/uuid v1.2.0
github.com/gorilla/mux v1.8.0
)

replace github.com/alebabai/go-kit-kafka => ../../
93 changes: 54 additions & 39 deletions examples/common/go.sum → _examples/common/go.sum

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func main() {
var httpServer *http.Server
{
httpServer = &http.Server{
Addr: ":8080",
Addr: ":8081",
Handler: consumer.NewHTTPHandler(endpoints),
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ services:
environment:
BROKER_ADDR: kafka:9092
volumes:
- .:/app
- $GOPATH/pkg/mod:/go/pkg/mod
- ../..:/app
working_dir: /app
command: sh -c "go mod tidy && go run ./cmd/producer"
command: sh -c "cd ./_examples/confluent && go mod download && go run ./cmd/producer"
ports:
- 8080:8080

Expand All @@ -49,9 +48,8 @@ services:
environment:
BROKER_ADDR: kafka:9092
volumes:
- .:/app
- $GOPATH/pkg/mod:/go/pkg/mod
- ../..:/app
working_dir: /app
command: sh -c "go mod tidy && go run ./cmd/consumer"
command: sh -c "cd ./_examples/confluent && go mod download && go run ./cmd/consumer"
ports:
- 8081:8081
15 changes: 15 additions & 0 deletions _examples/confluent/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module github.com/alebabai/go-kit-kafka/examples/confluent

go 1.16

require (
github.com/alebabai/go-kit-kafka v0.0.0
github.com/alebabai/go-kit-kafka/examples/common v0.0.0
github.com/confluentinc/confluent-kafka-go v1.8.2
github.com/go-kit/kit v0.13.0
github.com/go-kit/log v0.2.1
)

replace github.com/alebabai/go-kit-kafka => ../..

replace github.com/alebabai/go-kit-kafka/examples/common => ../common
95 changes: 54 additions & 41 deletions examples/confluent/go.sum → _examples/confluent/go.sum

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func main() {
var httpServer *http.Server
{
httpServer = &http.Server{
Addr: ":8080",
Addr: ":8081",
Handler: consumer.NewHTTPHandler(endpoints),
}

Expand Down
File renamed without changes.
10 changes: 4 additions & 6 deletions examples/sarama/compose.yml → _examples/sarama/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ services:
environment:
BROKER_ADDR: kafka:9092
volumes:
- .:/app
- $GOPATH/pkg/mod:/go/pkg/mod
- ../..:/app
working_dir: /app
command: sh -c "go mod tidy && go run ./cmd/producer"
command: sh -c "cd ./_examples/sarama && go mod download && go run ./cmd/producer"
ports:
- 8080:8080

Expand All @@ -49,9 +48,8 @@ services:
environment:
BROKER_ADDR: kafka:9092
volumes:
- .:/app
- $GOPATH/pkg/mod:/go/pkg/mod
- ../..:/app
working_dir: /app
command: sh -c "go mod tidy && go run ./cmd/consumer"
command: sh -c "cd ./_examples/sarama && go mod download && go run ./cmd/consumer"
ports:
- 8081:8081
15 changes: 15 additions & 0 deletions _examples/sarama/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module github.com/alebabai/go-kit-kafka/examples/sarama

go 1.16

require (
github.com/Shopify/sarama v1.32.0
github.com/alebabai/go-kit-kafka v0.0.0
github.com/alebabai/go-kit-kafka/examples/common v0.0.0
github.com/go-kit/kit v0.13.0
github.com/go-kit/log v0.2.1
)

replace github.com/alebabai/go-kit-kafka => ../..

replace github.com/alebabai/go-kit-kafka/examples/common => ../common
120 changes: 82 additions & 38 deletions examples/sarama/go.sum → _examples/sarama/go.sum

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions examples/common/go.mod

This file was deleted.

11 changes: 0 additions & 11 deletions examples/confluent/go.mod

This file was deleted.

11 changes: 0 additions & 11 deletions examples/sarama/go.mod

This file was deleted.

0 comments on commit 5afbd45

Please sign in to comment.