Skip to content

Commit

Permalink
fix buf.io imports
Browse files Browse the repository at this point in the history
  • Loading branch information
thefuga committed Jan 8, 2024
1 parent 4f55143 commit dc42caa
Show file tree
Hide file tree
Showing 8 changed files with 665 additions and 40 deletions.
19 changes: 10 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ module github.com/thefuga/go-poc
go 1.18

require (
buf.build/gen/go/thefuga/go-poc/grpc/go v1.3.0-20220711145547-e6891151c45d.2
buf.build/gen/go/thefuga/go-poc/protocolbuffers/go v1.28.1-20220711145547-e6891151c45d.4
github.com/confluentinc/confluent-kafka-go v1.9.1
github.com/gofiber/fiber/v2 v2.28.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.19.0
github.com/spf13/viper v1.11.0
go.buf.build/grpc/go/thefuga/go-poc v1.3.2
go.uber.org/fx v1.17.1
google.golang.org/grpc v1.46.0
google.golang.org/grpc v1.53.0
)

require (
Expand All @@ -24,7 +25,7 @@ require (
github.com/nxadm/tail v1.4.8 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
Expand All @@ -36,13 +37,13 @@ require (
go.uber.org/dig v1.14.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.17.0 // indirect
golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20220503193339-ba3ae3f07e29 // indirect
google.golang.org/protobuf v1.28.0 // indirect
golang.org/x/net v0.5.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/text v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
668 changes: 646 additions & 22 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/order/dto/cancel_order.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dto

import (
proto "buf.build/gen/go/thefuga/go-poc/protocolbuffers/go/order/v1"
"github.com/thefuga/go-poc/internal/order/event"
proto "go.buf.build/grpc/go/thefuga/go-poc/order/v1"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion internal/order/dto/create_order.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/thefuga/go-poc/internal/order/event"
"github.com/thefuga/go-poc/internal/order/model"

proto "buf.build/gen/go/thefuga/go-poc/protocolbuffers/go/order/v1"
"github.com/gofiber/fiber/v2"
proto "go.buf.build/grpc/go/thefuga/go-poc/order/v1"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion internal/order/dto/pay_order.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dto

import (
proto "buf.build/gen/go/thefuga/go-poc/protocolbuffers/go/order/v1"
"github.com/thefuga/go-poc/internal/order/event"
proto "go.buf.build/grpc/go/thefuga/go-poc/order/v1"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion internal/order/grpc/grpc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package grpc
import (
"github.com/thefuga/go-poc/internal/order/channel"

order "go.buf.build/grpc/go/thefuga/go-poc/order/v1"
order "buf.build/gen/go/thefuga/go-poc/grpc/go/order/v1/orderv1grpc"
"go.uber.org/fx"
"google.golang.org/grpc"
)
Expand Down
3 changes: 1 addition & 2 deletions internal/order/grpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ package grpc
import (
"context"

order "buf.build/gen/go/thefuga/go-poc/protocolbuffers/go/order/v1"
"github.com/thefuga/go-poc/internal/order/channel"
"github.com/thefuga/go-poc/internal/order/dto"
"github.com/thefuga/go-poc/internal/order/event"

order "go.buf.build/grpc/go/thefuga/go-poc/order/v1"
)

type OrderHandler struct {
Expand Down
7 changes: 4 additions & 3 deletions tests/order/grpc/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import (
"github.com/thefuga/go-poc/internal/order/event"
orderHandler "github.com/thefuga/go-poc/internal/order/grpc"

orderGRPC "buf.build/gen/go/thefuga/go-poc/grpc/go/order/v1/orderv1grpc"
orderProto "buf.build/gen/go/thefuga/go-poc/protocolbuffers/go/order/v1"
"github.com/spf13/viper"
orderGRPC "go.buf.build/grpc/go/thefuga/go-poc/order/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"

Expand Down Expand Up @@ -85,14 +86,14 @@ var _ = Describe("grpc calls on order handler", func() {
Describe("Create method", func() {
It("sends a create event to the creation producer channel", func() {
var (
respChan = make(chan *orderGRPC.CreateResponse, 1)
respChan = make(chan *orderProto.CreateResponse, 1)
errChan = make(chan error)
)

go func() {
resp, err := OrderClient.Create(
context.Background(),
&orderGRPC.CreateRequest{UserId: 1, ProductId: 2},
&orderProto.CreateRequest{UserId: 1, ProductId: 2},
)

respChan <- resp
Expand Down

0 comments on commit dc42caa

Please sign in to comment.