Skip to content

Commit

Permalink
Merge pull request #124 from optiopay/v2-subdirectory
Browse files Browse the repository at this point in the history
Move library implementation into v2 subdirectory
  • Loading branch information
dgellow committed Nov 4, 2019
2 parents 6143e91 + 9c919f5 commit 7d36549
Show file tree
Hide file tree
Showing 49 changed files with 85 additions and 30 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Kafka

on:
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.12.x"]
name: Go ${{ matrix.go }} test
steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Setup go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}

- name: Run tests for v2
run: cd v2 && go test ./...
env:
GO111MODULE: on

lint:
runs-on: ubuntu-latest
name: Lint

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: golangci-lint
uses: docker://reviewdog/action-golangci-lint:v1
with:
github_token: ${{ secrets.github_token }}
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* samuel.el-borai@optiopay.com sergei.tiutnev@optiopay.com mikhail.kochegarov@optiopay.com maksim.zhylinski@optiopay.com max.lavrenov@optiopay.com
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
"os"
"strings"

"github.com/optiopay/kafka"
"github.com/optiopay/kafka/proto"
"github.com/optiopay/kafka/v2"
"github.com/optiopay/kafka/v2/proto"
)

const (
Expand Down
5 changes: 0 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
module github.com/optiopay/kafka

go 1.13

require (
github.com/fsouza/go-dockerclient v1.4.4
github.com/golang/snappy v0.0.1
)
2 changes: 1 addition & 1 deletion broker.go → v2/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"syscall"
"time"

"github.com/optiopay/kafka/proto"
"github.com/optiopay/kafka/v2/proto"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion broker_test.go → v2/broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"
"time"

"github.com/optiopay/kafka/proto"
"github.com/optiopay/kafka/v2/proto"
)

// newTestBrokerConf returns BrokerConf with default configuration adjusted for
Expand Down
2 changes: 1 addition & 1 deletion connection.go → v2/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"sync"
"time"

"github.com/optiopay/kafka/proto"
"github.com/optiopay/kafka/v2/proto"
)

// ErrClosed is returned as result of any request made using closed connection.
Expand Down
8 changes: 4 additions & 4 deletions connection_test.go → v2/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (
"testing"
"time"

"github.com/optiopay/kafka/proto"
"github.com/optiopay/kafka/v2/proto"
)

const TLSCaFile = "./testkeys/ca.crt"
const TLSCertFile = "./testkeys/oats.crt"
const TLSKeyFile = "./testkeys/oats.key"
const TLSCaFile = "../testkeys/ca.crt"
const TLSCertFile = "../testkeys/oats.crt"
const TLSKeyFile = "../testkeys/oats.key"

type serializableMessage interface {
Bytes() ([]byte, error)
Expand Down
2 changes: 1 addition & 1 deletion distributing_producer.go → v2/distributing_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"sync"
"time"

"github.com/optiopay/kafka/proto"
"github.com/optiopay/kafka/v2/proto"
)

// DistributingProducer is the interface similar to Producer, but never require
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"sync"
"testing"

"github.com/optiopay/kafka/proto"
"github.com/optiopay/kafka/v2/proto"
)

type recordingProducer struct {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion example_test.go → v2/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package kafka
import (
"fmt"

"github.com/optiopay/kafka/proto"
"github.com/optiopay/kafka/v2/proto"
)

func ExampleConsumer() {
Expand Down
8 changes: 8 additions & 0 deletions v2/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module github.com/optiopay/kafka/v2

go 1.13

require (
github.com/fsouza/go-dockerclient v1.4.4
github.com/golang/snappy v0.0.1
)
11 changes: 11 additions & 0 deletions go.sum → v2/go.sum
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU=
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/Microsoft/hcsshim v0.8.6 h1:ZfF0+zZeYdzMIVMZHKtDKJvLHj76XCuVae/jNkjj0IA=
github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/containerd/continuity v0.0.0-20181203112020-004b46473808 h1:4BX8f882bXEDKfWIf0wa8HRvpnBoPszJJXL+TVbBw4M=
github.com/containerd/continuity v0.0.0-20181203112020-004b46473808/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug=
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
Expand All @@ -27,12 +31,14 @@ github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/ijc/Gotty v0.0.0-20170406111628-a8b993ba6abd h1:anPrsicrIi2ColgWTVPk+TrN42hJIWlfPHSBP9S0ZkM=
github.com/ijc/Gotty v0.0.0-20170406111628-a8b993ba6abd/go.mod h1:3LVOLeyx9XVvwPgrt2be44XgSqndprz1G18rSk8KD84=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
Expand All @@ -42,19 +48,23 @@ github.com/opencontainers/runc v0.1.1 h1:GlxAyO6x8rfZYN9Tt0Kti5a/cP41iuiO2yYT0IJ
github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand All @@ -72,5 +82,6 @@ google.golang.org/genproto v0.0.0-20180831171423-11092d34479b h1:lohp5blsw53GBXt
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/grpc v1.22.0 h1:J0UbZOIrCAl+fpTOf8YLs4dJo8L/owV4LYVtAXQoPkw=
google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
File renamed without changes.
4 changes: 2 additions & 2 deletions integration/broker_test.go → v2/integration/broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"
"time"

"github.com/optiopay/kafka"
"github.com/optiopay/kafka/proto"
"github.com/optiopay/kafka/v2"
"github.com/optiopay/kafka/v2/proto"
)

func TestProduceAndConsume(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion integration/cluster.go → v2/integration/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"

"github.com/fsouza/go-dockerclient"
"github.com/optiopay/kafka"
"github.com/optiopay/kafka/v2"

"testing"
)
Expand Down
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.
File renamed without changes.
4 changes: 2 additions & 2 deletions kafkatest/broker.go → v2/kafkatest/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"sync"
"time"

"github.com/optiopay/kafka"
"github.com/optiopay/kafka/proto"
"github.com/optiopay/kafka/v2"
"github.com/optiopay/kafka/v2/proto"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions kafkatest/broker_test.go → v2/kafkatest/broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"
"time"

"github.com/optiopay/kafka"
"github.com/optiopay/kafka/proto"
"github.com/optiopay/kafka/v2"
"github.com/optiopay/kafka/v2/proto"
)

func TestBrokerProducer(t *testing.T) {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions kafkatest/example_test.go → v2/kafkatest/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"reflect"
"time"

"github.com/optiopay/kafka"
"github.com/optiopay/kafka/proto"
"github.com/optiopay/kafka/v2"
"github.com/optiopay/kafka/v2/proto"
)

func ExampleBroker_Producer() {
Expand Down
2 changes: 1 addition & 1 deletion kafkatest/server.go → v2/kafkatest/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"sync"
"time"

"github.com/optiopay/kafka/proto"
"github.com/optiopay/kafka/v2/proto"
)

type topicOffset struct {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion multiplexer.go → v2/multiplexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"sync"

"github.com/optiopay/kafka/proto"
"github.com/optiopay/kafka/v2/proto"
)

// ErrMxClosed is returned as a result of closed multiplexer consumption.
Expand Down
2 changes: 1 addition & 1 deletion multiplexer_test.go → v2/multiplexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/optiopay/kafka/proto"
"github.com/optiopay/kafka/v2/proto"
)

type fetcher struct {
Expand Down
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion server_test.go → v2/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"sync"
"time"

"github.com/optiopay/kafka/proto"
"github.com/optiopay/kafka/v2/proto"
)

const (
Expand Down

0 comments on commit 7d36549

Please sign in to comment.