Skip to content

Commit

Permalink
Fixing problems at examples and update dependencies (#238)
Browse files Browse the repository at this point in the history
* Fixing problems at examples

* go mod tidy

Co-authored-by: Henrique Oelze <henrique.oelze@wildlifestudios.com>
  • Loading branch information
henriqueoelze and Henrique Oelze committed Aug 19, 2021
1 parent c190e9b commit 68bc5e0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/demo/cluster/services/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (c *Connector) GetSessionData(ctx context.Context) (*SessionData, error) {
}

// SetSessionData sets the session data
func (c *Connector) SetSessionData(ctx context.Context, data *SessionData) (*Response, error) {
func (c *Connector) SetSessionData(ctx context.Context, data *SessionData) (*protos.Response, error) {
s := c.app.GetSessionFromCtx(ctx)
err := s.SetData(data.Data)
if err != nil {
Expand All @@ -89,7 +89,7 @@ func (c *ConnectorRemote) RemoteFunc(ctx context.Context, msg *protos.RPCMsg) (*
}

// Docs returns documentation
func (c *ConnectorRemote) Docs(ctx context.Context, ddd *pitayaprotos.Doc) (*protos.Doc, error) {
func (c *ConnectorRemote) Docs(ctx context.Context, ddd *pitayaprotos.Doc) (*pitayaprotos.Doc, error) {
d, err := c.app.Documentation(true)
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions examples/demo/pipeline/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (g *MetagameServer) HandlerNoArg(ctx context.Context) (*HandlerNoArgRespons
// IMPORTANT: that this kind of pipeline will be hard to exist in real code
// as a pipeline function executes for every handler and each of them
// most probably have different parameter types.
func (g *MetagameServer) simpleBefore(ctx context.Context, in interface{}) (interface{}, error) {
func (g *MetagameServer) simpleBefore(ctx context.Context, in interface{}) (context.Context, interface{}, error) {
logger := pitaya.GetDefaultLoggerFromCtx(ctx)
logger.Info("Simple Before exec")

Expand All @@ -76,7 +76,7 @@ func (g *MetagameServer) simpleBefore(ctx context.Context, in interface{}) (inte
logger.Infof("SoftCurrency: %d", createPlayerArgs.SoftCurrency)
logger.Infof("HardCurrency: %d", createPlayerArgs.HardCurrency)
}
return in, nil
return ctx, in, nil
}

// Simple example of an after pipeline. The 2nd argument is the handler response.
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ require (
github.com/nats-io/nats-server/v2 v2.2.0
github.com/nats-io/nats.go v1.10.1-0.20210228004050-ed743748acac
github.com/nats-io/nuid v1.0.1
github.com/onsi/ginkgo v1.8.0 // indirect
github.com/onsi/gomega v1.5.0 // indirect
github.com/opentracing/opentracing-go v1.2.0
github.com/orfjackal/nanospec.go v0.0.0-20120727230329-de4694c1d701 // indirect
github.com/prometheus/client_golang v1.10.0
Expand All @@ -35,5 +33,5 @@ require (
go.etcd.io/etcd v0.0.0-20210226220824-aa7126864d82
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
google.golang.org/grpc v1.29.1
google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12
google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12
)
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,7 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis=
github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74=
Expand Down

0 comments on commit 68bc5e0

Please sign in to comment.