Skip to content

Commit

Permalink
upgrade protobuf library
Browse files Browse the repository at this point in the history
  • Loading branch information
mangalaman93 authored and shivaji-kharse committed Oct 8, 2024
1 parent cf2638d commit 3fb9dd6
Show file tree
Hide file tree
Showing 7 changed files with 1,746 additions and 6,409 deletions.
5 changes: 3 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"

"github.com/dgraph-io/dgo/v240/protos/api"
)
Expand Down Expand Up @@ -135,7 +136,7 @@ func (d *Dgraph) login(ctx context.Context, userid string, password string,
return err
}

return d.jwt.Unmarshal(resp.Json)
return proto.Unmarshal(resp.Json, &d.jwt)
}

// GetJwt returns back the JWT for the dgraph client.
Expand Down Expand Up @@ -205,7 +206,7 @@ func (d *Dgraph) retryLogin(ctx context.Context) error {
return err
}

return d.jwt.Unmarshal(resp.Json)
return proto.Unmarshal(resp.Json, &d.jwt)
}

func (d *Dgraph) getContext(ctx context.Context) context.Context {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/dgraph-io/dgo/v240
go 1.22.6

require (
github.com/gogo/protobuf v1.3.2
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.9.0
google.golang.org/grpc v1.67.1
google.golang.org/protobuf v1.34.2
)

require (
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
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/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
6 changes: 3 additions & 3 deletions protos/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ clean:
.PHONY: check
check:
echo "Installing proto libraries to versions in go.mod." ; \
go install github.com/golang/protobuf/protoc-gen-go ; \
go install github.com/gogo/protobuf/protoc-gen-gogofaster
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0 ; \
go install google.golang.org/grpc/cmd/protoc-gen-[email protected]

.PHONY: regenerate
regenerate: check clean
@protoc --gogofaster_out=plugins=grpc:api api.proto
@protoc --go_out=api --go-grpc_out=api --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative api.proto
@echo Done.
7 changes: 1 addition & 6 deletions protos/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@ syntax = "proto3";

package api;

/* import "gogoproto/gogo.proto"; */

/* option (gogoproto.marshaler_all) = true; */
/* option (gogoproto.sizer_all) = true; */
/* option (gogoproto.unmarshaler_all) = true; */
/* option (gogoproto.goproto_getters_all) = true; */
option go_package = "github.com/dgraph-io/dgo/v240/protos/api";

option java_package = "io.dgraph";
option java_outer_classname = "DgraphProto";
Expand Down
Loading

0 comments on commit 3fb9dd6

Please sign in to comment.