Skip to content

Commit

Permalink
feat: V1 Stabilization (#5)
Browse files Browse the repository at this point in the history
- export tracing constants with appropriate type
- refine examples
  - exclude from module
  - use local version of `go-kit-kafka` and `common` modules
  - minor fixes
- refactor documentation
- update infra

closing #4 #2 #3
  • Loading branch information
alebabai authored Feb 13, 2024
1 parent b790115 commit 1fb8663
Show file tree
Hide file tree
Showing 55 changed files with 374 additions and 296 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.16
- run: go version
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
Expand All @@ -23,11 +23,11 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: Lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
version: v1.50
version: v1.55.2
- name: Build
run: make build
- name: Test
run: make test
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
24 changes: 7 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
# Go workspace file
go.work

### Go Patch ###
/vendor/
/Godeps/

### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
Expand Down Expand Up @@ -108,20 +104,13 @@ fabric.properties
.idea/caches/build_file_checksums.ser

### Intellij+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
# Ignore everything but code style settings and run configurations
# that are supposed to be shared within teams.

.idea/*

# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023

*.iml
modules.xml
.idea/misc.xml
*.ipr

# Sonarlint plugin
.idea/sonarlint
!.idea/codeStyles
!.idea/runConfigurations

### VisualStudioCode ###
.vscode/*
Expand All @@ -142,6 +131,7 @@ modules.xml
.history
.ionide

# Support for Project snippet scope

# End of https://www.toptal.com/developers/gitignore/api/go,intellij+all,visualstudiocode

coverage.txt
coverage.html
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GO ?= @go
GO ?= @go

PACKAGES ?= ./...
TEST_PACKAGES ?= $(PACKAGES)
PACKAGES ?= ./...
TEST_PACKAGES ?= ./...
COVER_PACKAGES ?= $(shell echo $(TEST_PACKAGES) | tr " " ",")
COVER_PROFILE ?= coverage.out

Expand All @@ -14,12 +14,12 @@ all: build test
fmt:
$(GO) fmt $(PACKAGES)

.PHONY: mod/download
mod/download:
$(GO) mod download
.PHONY: mod/tidy
mod/tidy:
$(GO) mod tidy

.PHONY: prepare
prepare: mod/download fmt
prepare: mod/tidy fmt

.PHONY: build
build: prepare
Expand Down
6 changes: 3 additions & 3 deletions examples/README.md → _examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

### Docker

Bootstrap full project using docker-compose:
Bootstrap full project using docker compose:

```bash
docker-compose -f <example>/docker-compose.yml up
docker compose -f <example>/compose.yml up
```

To produce an event send the following request:
Expand All @@ -38,4 +38,4 @@ To view all events send the following request:
```bash
curl -X GET http://localhost:8081/events

```
```
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
@@ -1,4 +1,4 @@
version: '3'
version: '3.7'

services:
zookeeper:
Expand Down 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 download && 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 download && 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
Loading

0 comments on commit 1fb8663

Please sign in to comment.