Skip to content

Commit

Permalink
fixing sdk implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Fernando Rocha <[email protected]>
  • Loading branch information
rochabr committed Jul 22, 2024
1 parent ce4a725 commit 39f0e7e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
1 change: 0 additions & 1 deletion jobs/go/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ expected_stdout_lines:
- '== APP - job-service == Received job request...'
- '== APP - job-service == Executing maintenance job: Oil Change'
- '== APP - job-scheduler == Job Scheduled: C-3PO'
- '== APP - job-scheduler == Job details: {"name":"C-3PO", "dueTime":"30s", "data":{"@type":"type.googleapis.com/google.protobuf.StringValue", "value":"C-3PO:Limb Calibration"}}'
- '== APP - job-service == Received job request...'
- '== APP - job-service == Executing maintenance job: Limb Calibration'
expected_stderr_lines:
Expand Down
4 changes: 2 additions & 2 deletions jobs/go/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ The output should be:
== APP == Registered job handler for: R2-D2
== APP == Registered job handler for: C-3PO
== APP == Registered job handler for: BB-8
== APP == Starting server on port: 5200
== APP == Starting server on port: 6200
```

2. On a new terminal window, run the `job-scheduler` app:
Expand All @@ -124,7 +124,7 @@ dapr run --app-id job-scheduler --app-port 6300 -- go run .
The output should be:

```text
== APP == dapr client initializing for: 127.0.0.1:63896
== APP == dapr client initializing for:
== APP == Get job response: {"droid":"C-3PO","Task":"Memory Wipe"}
== APP == Get job response: {"droid":"BB-8","Task":"Internal Gyroscope Check"}
== APP == Job deleted: BB-8
Expand Down
5 changes: 1 addition & 4 deletions jobs/go/sdk/job-scheduler/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module dapr_job_example

go 1.22.5

require github.com/dapr/go-sdk v0.0.0-00010101000000-000000000000
require github.com/dapr/go-sdk v1.10.0-rc-1.0.20240722191953-77c213de6164

require (
github.com/dapr/dapr v1.14.0-rc.2 // indirect
Expand All @@ -17,6 +17,3 @@ require (
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

//replace github.com/dapr/go-sdk => github.com/mikeee/dapr_go-sdk v0.0.0-9008fd7e91b1562678ec84f3383950dbda4b7449
replace github.com/dapr/go-sdk => /Users/rocha/Developer/dapr/go-sdk
2 changes: 2 additions & 0 deletions jobs/go/sdk/job-scheduler/go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.14.0-rc.2 h1:wuXninZLTyokeztCinVIVAc9mpVYJS8QyxecPCLdlY8=
github.com/dapr/dapr v1.14.0-rc.2/go.mod h1:uZMuD9K7y+LKSsQUoSAvv1Yn8Cim9X/9ZQ9XuTobyP8=
github.com/dapr/go-sdk v1.10.0-rc-1.0.20240722191953-77c213de6164 h1:zFl/d1LAz/dwCApp5HRsRC8eabB0SkAqEAqyB5f4XYA=
github.com/dapr/go-sdk v1.10.0-rc-1.0.20240722191953-77c213de6164/go.mod h1:Xit2/1Go+fYy/TXrpf8oEefluvXtuvmC+nKEd3wJdQE=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
Expand Down
5 changes: 1 addition & 4 deletions jobs/go/sdk/job-service/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module dapr_job_example
go 1.22.5

require (
github.com/dapr/go-sdk v0.0.0-00010101000000-000000000000
github.com/dapr/go-sdk v1.10.0-rc-1.0.20240722191953-77c213de6164
google.golang.org/protobuf v1.34.2
)

Expand All @@ -19,6 +19,3 @@ require (
google.golang.org/grpc v1.65.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

//replace github.com/dapr/go-sdk => github.com/mikeee/dapr_go-sdk v0.0.0-9008fd7e91b1562678ec84f3383950dbda4b7449
replace github.com/dapr/go-sdk => /Users/rocha/Developer/dapr/go-sdk
4 changes: 4 additions & 0 deletions jobs/go/sdk/job-service/go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.14.0-rc.2 h1:wuXninZLTyokeztCinVIVAc9mpVYJS8QyxecPCLdlY8=
github.com/dapr/dapr v1.14.0-rc.2/go.mod h1:uZMuD9K7y+LKSsQUoSAvv1Yn8Cim9X/9ZQ9XuTobyP8=
github.com/dapr/go-sdk v1.10.0-rc-1.0.20240722191953-77c213de6164 h1:zFl/d1LAz/dwCApp5HRsRC8eabB0SkAqEAqyB5f4XYA=
github.com/dapr/go-sdk v1.10.0-rc-1.0.20240722191953-77c213de6164/go.mod h1:Xit2/1Go+fYy/TXrpf8oEefluvXtuvmC+nKEd3wJdQE=
github.com/dapr/go-sdk v1.10.1 h1:g6mM2RXyGkrzsqWFfCy8rw+UAt1edQEgRaQXT+XP4PE=
github.com/dapr/go-sdk v1.10.1/go.mod h1:lPjyF/xubh35fbdNdKkxBbFxFNCmta4zmvsk0JxuUG0=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
Expand Down
4 changes: 1 addition & 3 deletions jobs/go/sdk/job-service/job-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ import (
"github.com/dapr/go-sdk/service/common"
"google.golang.org/protobuf/types/known/anypb"

daprs "github.com/dapr/go-sdk/service/grpc"
//daprs "github.com/dapr/go-sdk/service/http"

daprc "github.com/dapr/go-sdk/client"
daprs "github.com/dapr/go-sdk/service/grpc"
)

type App struct {
Expand Down

0 comments on commit 39f0e7e

Please sign in to comment.