Skip to content

Commit

Permalink
cleamup: remove buf templates use
Browse files Browse the repository at this point in the history
  • Loading branch information
ravisuhag committed Jun 12, 2023
1 parent aee7057 commit f56a63b
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 51 deletions.
24 changes: 0 additions & 24 deletions common/service.go

This file was deleted.

1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ require (
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.8.1
github.com/stretchr/testify v1.8.0
go.buf.build/raystack/gw/raystack/proton v1.1.9
go.uber.org/zap v1.19.0
golang.org/x/net v0.0.0-20220919232410-f2f64ebce3c1 // indirect
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1265,10 +1265,6 @@ github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPS
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg=
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b/go.mod h1:T3BPAOm2cqquPa0MKWeNkmOM5RQsRhkrwMWonFMN7fE=
go.buf.build/raystack/gw/grpc-ecosystem/grpc-gateway v1.1.35 h1:d5dMyaXBowF98Oylwhyr4eM1yB17UWWTuoSEk5WRrMM=
go.buf.build/raystack/gw/grpc-ecosystem/grpc-gateway v1.1.35/go.mod h1:/LuddrGPi0fwj7ay6Orutt8oFfPz8Y3c8qdBkacJq1A=
go.buf.build/raystack/gw/raystack/proton v1.1.9 h1:iEdRUVVc/HwOqB7WRXjhXjR2pza2gyUbQ74G2sBlWHU=
go.buf.build/raystack/gw/raystack/proton v1.1.9/go.mod h1:I9E8CF7w/690vRNWqBU6qDcUbi3Pi2THdn1yycBVTDQ=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
Expand Down
6 changes: 0 additions & 6 deletions mux/_example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/raystack/salt/common"
"github.com/raystack/salt/mux"
commonv1 "go.buf.build/raystack/gw/raystack/proton/raystack/common/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
)
Expand All @@ -22,14 +21,9 @@ func main() {

grpcServer := grpc.NewServer()

commonSvc := SlowCommonService{common.New(&commonv1.Version{Version: "0.0.1"})}
commonv1.RegisterCommonServiceServer(grpcServer, commonSvc)
reflection.Register(grpcServer)

grpcGateway := runtime.NewServeMux()
if err := commonv1.RegisterCommonServiceHandlerServer(ctx, grpcGateway, commonSvc); err != nil {
panic(err)
}

httpMux := http.NewServeMux()
httpMux.Handle("/api/", http.StripPrefix("/api", grpcGateway))
Expand Down
16 changes: 0 additions & 16 deletions server/example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,11 @@ import (
grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery"
grpc_ctxtags "github.com/grpc-ecosystem/go-grpc-middleware/tags"
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
"github.com/raystack/salt/common"
"github.com/raystack/salt/server"
commonv1 "go.buf.build/raystack/gw/raystack/proton/raystack/common/v1"
"go.uber.org/zap"
"google.golang.org/grpc"
)

var Server = &commonv1.Version{
Version: "v1.0.2",
}

var GRPCMiddlewaresInterceptor = grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(
grpc_recovery.UnaryServerInterceptor(),
grpc_ctxtags.UnaryServerInterceptor(),
Expand Down Expand Up @@ -54,7 +48,6 @@ func httpS(httpPort, gatewayClientPort int) {
if err != nil {
panic(err)
}
gw.RegisterHandler(ctx, commonv1.RegisterCommonServiceHandlerFromEndpoint)

s.SetGateway("/api", gw)
s.RegisterHandler("/ping", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand All @@ -80,10 +73,6 @@ func grpcS(grpcPort int) {
panic(err)
}

s.RegisterService(&commonv1.CommonService_ServiceDesc,
common.New(Server),
)

go s.Serve()
<-ctx.Done()
shutdownCtx, shutdownCancel := context.WithTimeout(context.Background(), time.Second*10)
Expand All @@ -108,18 +97,13 @@ func muxS(muxPort int) {
if err != nil {
panic(err)
}
gw.RegisterHandler(ctx, commonv1.RegisterCommonServiceHandlerFromEndpoint)

s.SetGateway("/api", gw)

s.RegisterHandler("/ping", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "pong")
}))

s.RegisterService(&commonv1.CommonService_ServiceDesc,
common.New(Server),
)

go s.Serve()
<-ctx.Done()
// clean anything that needs to be closed etc like common server implementation etc
Expand Down

0 comments on commit f56a63b

Please sign in to comment.