Commit Graph

278 Commits

Author SHA1 Message Date
HaoTian 7bcbf27f51
chore: remove the binary and add gitignore (#315)
Signed-off-by: 117503445 <t117503445@gmail.com>

Signed-off-by: 117503445 <t117503445@gmail.com>
2022-09-30 20:28:16 -07:00
Alessandro (Ale) Segala cfd74830c9
Expose underlying gRPC client and server objects (#311)
* Expose underlying gRPC client and server objects

Fixes #204

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Fixed reported race conditions

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Support for Go 1.17

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-09-30 15:56:05 -07:00
yellow chicks f182441168
feature(apphealth&configuration): add app health check & adapt new configuration API (#323)
* fix/typo: modify state  annotation

Signed-off-by: 1046102779 <seachen@tencent.com>

* feature(apphealth): add app health check

Signed-off-by: 1046102779 <seachen@tencent.com>

* feature(apphealth): add app health check

Signed-off-by: 1046102779 <seachen@tencent.com>

* feature(apphealth): add app health check

Signed-off-by: 1046102779 <seachen@tencent.com>

* feature(apphealth): add app health check

Signed-off-by: 1046102779 <seachen@tencent.com>

* feature(apphealth): add app health check

Signed-off-by: 1046102779 <seachen@tencent.com>

Signed-off-by: 1046102779 <seachen@tencent.com>
2022-09-30 15:19:16 -07:00
mikeb26 c89770a473
Add SaveStateWithETag() convenience function (#321)
In the state API there's an existing DeleteStateWithETag() convenience
function but there does not appear to be an equivalent
SaveStateWithETag(). This commit adds SetStateWithETag() so that
consumers of the SDK don't have to employ the more verbose
SaveBulkState() when they only need to update a singular item.

Client code updating a single item with an etag prior to this commit
looks like:

--
item := &dapr.SetStateItem{
	Etag: &dapr.ETag{
		Value: "deadbeef",
	},
	Key:   "order_1",
	Value: []byte(data),
}

err := client.SaveBulkState(ctx, store, item)
--

Client code after this commit can reduce to:

--
err := client.SaveStateWithEtag(ctx, store, "order_1", []byte(data), "deadbeef")
--

Signed-off-by: Mike Brown <github@torvosoft.com>

Signed-off-by: Mike Brown <github@torvosoft.com>
2022-09-28 09:47:33 -07:00
Chris Gillum c1556a4bf1
Fix panic in actor server when invalid methods encountered (#324)
I was debugging a panic in a local application I was developing and noticed this issue. A validation failure isn't correctly handled as a failure, and we insert a nil value into the map. This value in this map is later dereferenced, resulting in the following panic:

```
http: panic serving 127.0.0.1:45598: runtime error: invalid memory address or nil pointer dereference
goroutine 248 [running]:
net/http.(*conn).serve.func1()
        /home/linuxbrew/.linuxbrew/Cellar/go/1.19.1/libexec/src/net/http/server.go:1850 +0xbf
panic({0x9558a0, 0xe4d7c0})
        /home/linuxbrew/.linuxbrew/Cellar/go/1.19.1/libexec/src/runtime/panic.go:890 +0x262
github.com/dapr/go-sdk/actor/manager.(*DefaultActorContainer).Invoke(0xc0000be810, {0xc000048126?, 0x9?}, {0xc0003fc000, 0x4, 0x200})
        /home/cgillum/go/pkg/mod/github.com/dapr/go-sdk@v1.5.0/actor/manager/container.go:75 +0x299
github.com/dapr/go-sdk/actor/manager.(*DefaultActorManager).InvokeMethod(0xc000112300, {0xc000048115?, 0xc0000a3888?}, {0xc000048126, 0x4}, {0xc0003fc000, 0x4, 0x200})
        /home/cgillum/go/pkg/mod/github.com/dapr/go-sdk@v1.5.0/actor/manager/manager.go:92 +0xb2
github.com/dapr/go-sdk/actor/runtime.(*ActorRunTime).InvokeActorMethod(0xa?, {0xc00004810c?, 0x7f71edd544a0?}, {0xc000048115, 0x9}, {0xc000048126, 0x4}, {0xc0003fc000, 0x4, 0x200})
        /home/cgillum/go/pkg/mod/github.com/dapr/go-sdk@v1.5.0/actor/runtime/actor_runtime.go:75 +0xba
github.com/dapr/go-sdk/service/http.(*Server).registerBaseHandler.func4({0xad7298, 0xc0003b0000}, 0xc0004e4100)
        /home/cgillum/go/pkg/mod/github.com/dapr/go-sdk@v1.5.0/service/http/topic.go:112 +0x1be
net/http.HandlerFunc.ServeHTTP(0xc0004e4000?, {0xad7298?, 0xc0003b0000?}, 0x800?)
        /home/linuxbrew/.linuxbrew/Cellar/go/1.19.1/libexec/src/net/http/server.go:2109 +0x2f
github.com/gorilla/mux.(*Router).ServeHTTP(0xc000218240, {0xad7298, 0xc0003b0000}, 0xc0003b4600)
        /home/cgillum/go/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210 +0x1cf
net/http.serverHandler.ServeHTTP({0xad62e8?}, {0xad7298, 0xc0003b0000}, 0xc0003b4600)
        /home/linuxbrew/.linuxbrew/Cellar/go/1.19.1/libexec/src/net/http/server.go:2947 +0x30c
net/http.(*conn).serve(0xc0000001e0, {0xad7a00, 0xc00012b380})
        /home/linuxbrew/.linuxbrew/Cellar/go/1.19.1/libexec/src/net/http/server.go:1991 +0x607
created by net/http.(*Server).Serve
        /home/linuxbrew/.linuxbrew/Cellar/go/1.19.1/libexec/src/net/http/server.go:3102 +0x4db
```

The issue appears to be the error handling logic, which I've fixed in this PR.

Signed-off-by: Chris Gillum <cgillum@gmail.com>

Signed-off-by: Chris Gillum <cgillum@gmail.com>
2022-09-20 18:23:44 -07:00
Ceres Cartman 7c38f5a607
fix: client default timeout (#310)
* fix: client default timeout #259

Signed-off-by: Ceres Cheng <chengzhoukun@gmail.com>

* Add documentation for client timeout environment variable

Signed-off-by: Ceres Cheng <chengzhoukun@gmail.com>
2022-08-05 16:58:03 -07:00
yellow chicks c4217cfaf9
optimize: using `go mod init` to upgrade examples (#305)
* fix/typo: modify state  annotation

Signed-off-by: 1046102779 <seachen@tencent.com>

* optimize: upgrade go1.17->go1.18

Signed-off-by: 1046102779 <seachen@tencent.com>

* optimize: upgrade examples

Signed-off-by: 1046102779 <seachen@tencent.com>

* optimize: upgrade examples

Signed-off-by: 1046102779 <seachen@tencent.com>

* optimize: using go mod init to upgrade examples

Signed-off-by: 1046102779 <seachen@tencent.com>
2022-07-22 09:19:50 -07:00
Yaron Schneider 40c5fd5a19
Update dependencies (#302)
* update dependencies

Signed-off-by: yaron2 <schneider.yaron@live.com>

* update dependencies

Signed-off-by: yaron2 <schneider.yaron@live.com>
2022-07-08 06:33:24 -07:00
Yaron Schneider e086ac59a0
change ownerID to lockOwner (#301)
Signed-off-by: yaron2 <schneider.yaron@live.com>
2022-07-06 12:34:38 -07:00
Yaron Schneider 0b65cca826
Add distributed lock api support (#297)
* add distributed lock api support

Signed-off-by: yaron2 <schneider.yaron@live.com>

* go mod tidy for pub/sub

Signed-off-by: yaron2 <schneider.yaron@live.com>

* go mod tidy for state

Signed-off-by: yaron2 <schneider.yaron@live.com>

* go mod tidy for service invocation

Signed-off-by: yaron2 <schneider.yaron@live.com>

* linter

Signed-off-by: yaron2 <schneider.yaron@live.com>

* added unlock tests

Signed-off-by: yaron2 <schneider.yaron@live.com>
2022-06-22 10:37:17 +08:00
yellow chicks a1648db4ab
optimize: grpc methodName & http router (#289)
* fix/typo: modify state  annotation

Signed-off-by: 1046102779 <seachen@tencent.com>

* bugfix&optimize: grpc router bug&http invalid router

Signed-off-by: 1046102779 <seachen@tencent.com>

* bugfix&optimize: grpc router bug&http invalid router

Signed-off-by: 1046102779 <seachen@tencent.com>
2022-06-10 09:50:20 +08:00
yellow chicks d204f691ed
fix/typo: modify state annotation (#283)
Signed-off-by: 1046102779 <seachen@tencent.com>
2022-05-06 08:40:47 -07:00
Josh 24ccf7eb52
chore(client): update func definition to be clearer (#281)
Signed-off-by: Josh Dando <joshdando@Joshs-MacBook-Pro.local>

Co-authored-by: Josh Dando <joshdando@Joshs-MacBook-Pro.local>
2022-04-23 08:52:31 -07:00
Shubham Sharma 9b8d4027a8
Add condition (#267)
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
2022-04-20 20:36:18 +08:00
Shubham Sharma 7a63f3f197
Update fossa workflow's action version and trigger branches (#282)
* Pin fossa-action version

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update branch triggers

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
2022-04-20 12:27:30 +08:00
yellow chicks 37c6c59fb4
fix(typo): client configuration subscribe (#279)
Signed-off-by: 1046102779 <seachen@tencent.com>
2022-04-19 11:10:16 +08:00
thielepaul 885ee8d326
Expose base grpcclient over client interface (#272)
Signed-off-by: Paul Thiele <thielepaul@gmail.com>
2022-04-14 07:04:24 -07:00
Shubham Sharma 247a506004
Update golangci-lint-action to v3.1.0 (#274)
* Update golangci-lint-action

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Use the correct go version

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
2022-04-08 07:49:43 -07:00
Laurence 6f2ae7df71
fix: config api (#200)
* Fix: Finished Configuration API

Signed-off-by: LaurenceLiZhixin <382673304@qq.com>

* Fix: add configuration validation

Signed-off-by: LaurenceLiZhixin <382673304@qq.com>

* Fix: fix validation test

Signed-off-by: LaurenceLiZhixin <382673304@qq.com>

* Fix: remove validation

Signed-off-by: LaurenceLiZhixin <382673304@qq.com>

* add ut

Signed-off-by: LaurenceLiZhixin <382673304@qq.com>

* Fix: comment

Signed-off-by: LaurenceLiZhixin <382673304@qq.com>
2022-04-05 17:43:32 -07:00
Yaron Schneider f0e09312fa
Add option to disable topic validation (#271)
* Add option to disable topic validation

Signed-off-by: yaron2 <schneider.yaron@live.com>

* linter

Signed-off-by: yaron2 <schneider.yaron@live.com>
2022-04-01 08:38:56 +08:00
greenie-msft f1f5c7a84c
Update docs link for hello world tutorial (#270)
Signed-off-by: Nick Greenfield <nigreenf@microsoft.com>
2022-03-31 12:27:10 -07:00
Naveen Ramanathan d1a8a586ea
implement graceful shutdown (#260)
Signed-off-by: Naveen Ramanathan <nramanathan@infoblox.com>
2022-03-29 12:11:56 -07:00
Taction 365078470b
Simplify the use of pubsub rawPayload (#264)
* fix: simplify the use of pubsub rawPayload

Signed-off-by: zhangchao <zchao9100@gmail.com>

* add test

Signed-off-by: zhangchao <zchao9100@gmail.com>
2022-03-25 09:18:39 -07:00
Dmitry Shmulevich 9944bfebcc
update query test (#263)
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2022-03-25 09:17:09 -07:00
Shubham Sharma 2a7d3066c4
Add FOSSA workflow and badge (#266)
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
2022-03-11 19:34:07 +08:00
Dmitry Shmulevich a0a4a9e70a
allow passage of metadata to state store API (#262)
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2022-02-24 09:39:05 +08:00
thielepaul 49deb758ee
set subscription metadata in topicregistrar (fix #256) (#258)
Signed-off-by: Paul Thiele <thielepaul@gmail.com>
2022-02-18 13:26:14 +08:00
Josh 4298f3fa7d
chore: fix some spelling mistakes in the readme (#255)
Signed-off-by: Josh Dando <joshdando@Joshs-MacBook-Pro.local>

Co-authored-by: Josh Dando <joshdando@Joshs-MacBook-Pro.local>
2022-02-05 12:38:49 -08:00
Joni Collinge 8cc42bd7e3
Fix misspelt activateActor name (#253)
* fix misspelt deactiveActor method

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* fix mocks and tests

Signed-off-by: Joni Collinge <jonathancollinge@live.com>
2022-01-31 09:06:28 -08:00
huazhongming e53d1d8197
Support rename reminder (#251)
Signed-off-by: crazyhzm <crazyhzm@gmail.com>
2022-01-29 10:06:10 +08:00
Yaron Schneider af26939649
disable linter for release-on-tag (#249) 2022-01-25 11:56:49 -08:00
Yaron Schneider 1af6103d77
update protos (#248)
Signed-off-by: yaron2 <schneider.yaron@live.com>
2022-01-25 10:27:38 -08:00
望哥 69c6adcdb0
upgrade dapr to v1.6.0 (#246)
Signed-off-by: wongoo <wongoo@apache.org>
2022-01-24 19:41:44 -08:00
Dmitry Shmulevich d9be62fa69
chore - update dependencies (#240)
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2022-01-20 09:25:39 -08:00
Looong Dai f912500536
add Unix domain socket support (#206)
* add Unix domain socket support

Signed-off-by: Long <long0dai@foxmail.com>

* update examples

Signed-off-by: Long <long.dai@intel.com>
2022-01-13 09:40:24 -08:00
Timon Wong d3c3384c4e
Fix error saving actor state for readonly changes (#233)
Signed-off-by: Tianpeng Wang <tpwang@alauda.io>
2022-01-11 09:37:26 -08:00
Phil Kedy 40d8a4eabe
Pub/Sub routing support (#227)
Signed-off-by: Phil Kedy <phil.kedy@gmail.com>
2022-01-06 10:19:24 -08:00
yellow chicks 078d0cdc40
bugfix/apptoken: missing app token verification codes (#236)
Signed-off-by: 1046102779 <seachen@tencent.com>
2021-12-29 15:42:08 +08:00
Will 1673ee9e7a
Add DCO requirements and updated code of conduct (#235)
Issue reference: dapr/docs#2039

Signed-off-by: Will <william.wl.tsai@gmail.com>
2021-12-28 16:34:53 -08:00
greenie-msft 831379c503
Update LICENSE to Apache 2.0 (#220) 2021-12-15 10:50:07 +08:00
Dmitry Shmulevich 67e5c4ee3b
update go.mod in examples (#234)
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2021-12-14 15:08:18 -08:00
Dmitry Shmulevich a38be4e38b
replace license headers (#232)
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2021-12-14 12:06:12 -08:00
Phil Kedy 8a7a61b443
Decode CloudEvent Data consistently between HTTP and gRPC (#230)
* Decode CloudEvent Data consistently between HTTP and gRPC

Signed-off-by: Phil Kedy <phil.kedy@gmail.com>

* linter issue

Signed-off-by: Phil Kedy <phil.kedy@gmail.com>

* Added parsing media type

Signed-off-by: Phil Kedy <phil.kedy@gmail.com>

* Adding extension json media type handling

Signed-off-by: Phil Kedy <phil.kedy@gmail.com>

* add TTL to actor timer/reminder requests (#225)

Signed-off-by: Phil Kedy <phil.kedy@gmail.com>

* Adding more tests

Signed-off-by: Phil Kedy <phil.kedy@gmail.com>

* Tweak

Signed-off-by: Phil Kedy <phil.kedy@gmail.com>

Co-authored-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2021-12-08 21:06:35 -08:00
Dmitry Shmulevich 15fc672e08
add support for state query API (#216)
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2021-12-08 10:27:52 +08:00
Dmitry Shmulevich b93a185fa4
add TTL to actor timer/reminder requests (#225) 2021-12-08 09:36:48 +08:00
Laurence d9ad49d2a6
Feat: Add Go-sdk Actor Support (#196)
* ftr: init go-sdk action

* fix: finished design of actor-api's invoke feature

* fix: add readme

* fix: lint

* fix: add manager unit test

* fix: add actor state suport

* fix: add comments

* fix: add comment

* fix the change reqeust of pr

* fix: validate example test

* fix: linter

* add actor validation

* add actor validation

* fix: update actor validation init sleep time

* fix: add init time for validate example server

* fix: change actor to the end of test in order not to let reminder bother other test

* fix: validate test

* fix: typo of factory

* fix: add init time

* fix: ut

Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
Co-authored-by: Long Dai <long.dai@intel.com>
2021-11-02 14:45:27 -07:00
Michael Nussbaum 5d3a4ad3f2
Make client init fail if server connection fails (#213)
* Make client init fail if server connection fails

This prevents client/server connectivity issues from resulting in silent
failure modes and ensures they're caught as early as possible

* Fix linter errors

Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2021-10-31 14:59:07 -07:00
penghuima b5d09e8e57
minor fix (#214)
Signed-off-by: penghuima <2992426202@qq.com>
2021-10-31 14:55:04 -07:00
Phil Kedy de68193d5c
Use proto packages that exist in dapr/dapr instead of generating them locally in the SDK. This enables the ability to embed Dapr and also use the SDK to interact with the Dapr APIs. Also moved go mod to 1.17. (#211) 2021-10-17 11:23:06 +08:00
Alessandro (Ale) Segala 9fceff83a1
Rationalize PublishEvent* APIs (#179)
* Rationalize PublishEvent* APIs
Allow passing options such as Content-Type and Metadata in a flexible and future-proof way.
The method `PublishEventfromCustomContent` is now deprecated and shows a warning in the console when used.
Fixes #174, #164

* Do not wrap errors for invocations
Fix #186

* Updated variable name

* Added error check

* Oops

* Linting

Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
Co-authored-by: Phil Kedy <phil.kedy@gmail.com>
2021-10-07 10:18:57 -07:00