Commit Graph

78 Commits

Author SHA1 Message Date
Mike Nguyen dce63f1917
Add support for the conversation API (#646)
* feat: conversation api implementation

Signed-off-by: mikeee <hey@mike.ee>

* chore: deps for conversation api

Signed-off-by: mikeee <hey@mike.ee>

* fix: cleanup convo example

Signed-off-by: mikeee <hey@mike.ee>

* refactor: add a conversationrequest builder and docs

Signed-off-by: mikeee <hey@mike.ee>

* fix: lint and refactor, adding preallocations for ins/outs

Signed-off-by: Mike Nguyen <hey@mike.ee>

* fix: lint and imports

Signed-off-by: mikeee <hey@mike.ee>

* fix: bump to dapr master refs

Signed-off-by: mikeee <hey@mike.ee>

* fix: enable scheduler with cli fix + tidy

Signed-off-by: mikeee <hey@mike.ee>

---------

Signed-off-by: mikeee <hey@mike.ee>
Signed-off-by: Mike Nguyen <hey@mike.ee>
2024-11-27 07:57:22 -08:00
Fabian Martinez 87659bf63e
add deprecation comments (#650)
Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com>
2024-11-20 08:04:26 -08:00
Mike Nguyen 967570515b
Implement distributed scheduler building block (#562)
* feat: add jobs/scheduling api (with validation override)

Signed-off-by: mikeee <hey@mike.ee>

* chore: fix deps

Signed-off-by: mikeee <hey@mike.ee>

* fix: use cli fix

Signed-off-by: mikeee <hey@mike.ee>

* fix: ci artifact path set for cli build

Signed-off-by: mikeee <hey@mike.ee>

* chore: remove sidecar step

Signed-off-by: mikeee <hey@mike.ee>

* chore: revert changes to other examples

Signed-off-by: mikeee <hey@mike.ee>

---------

Signed-off-by: mikeee <hey@mike.ee>
Signed-off-by: Mike Nguyen <hey@mike.ee>
2024-07-17 09:04:45 -07:00
Josh van Leeuwen b7b90e3f8e
Bidirectional Subscriptions (#578)
* Bidirectional Subscriptions

Adds support for bidirectional subscriptions to PubSubs. Adds two
methods for subscribing- one using a callback and one using an
imperative approach. Both giving support to different programming styles
or use cases.

Adds example with tests.

Signed-off-by: joshvanl <me@joshvanl.dev>

* Linting: Remove unused `closeCh`

Signed-off-by: joshvanl <me@joshvanl.dev>

* Fixes comment order in bidisub.go

Signed-off-by: joshvanl <me@joshvanl.dev>

* Add comment about processing message

Signed-off-by: joshvanl <me@joshvanl.dev>

* Adds dead letter topic example

Signed-off-by: joshvanl <me@joshvanl.dev>

* chore: remove go.mod

Signed-off-by: mikeee <hey@mike.ee>

* Updates go mod to v1.14.0-rc.1

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: mikeee <hey@mike.ee>
Signed-off-by: Mike Nguyen <hey@mike.ee>
Co-authored-by: mikeee <hey@mike.ee>
2024-07-11 07:43:51 -07:00
Sam feb4bb675c
fix(security): bump security vulnerabilities (#582)
* fix(security): bump security vulnerabilities

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: make linter happy

Signed-off-by: Samantha Coyle <sam@diagrid.io>

---------

Signed-off-by: Samantha Coyle <sam@diagrid.io>
Signed-off-by: Mike Nguyen <hey@mike.ee>
Co-authored-by: Mike Nguyen <hey@mike.ee>
2024-07-01 17:27:27 -07:00
Gustavo Chaín 1a347b201c
allow to customize the default logger (#496)
Signed-off-by: Gustavo Chain <me@qustavo.cc>
2024-02-13 10:48:48 -08:00
mikeee ac26e622c4
feat: workflow authoring and management support (#487)
* feat: initial workflow

Signed-off-by: mikeee <hey@mike.ee>

* test: add activity context test for input

Signed-off-by: mikeee <hey@mike.ee>

* test: add context texts

Signed-off-by: mikeee <hey@mike.ee>

* fix/test: identify anonymous functions and add tests to runtime

Signed-off-by: mikeee <hey@mike.ee>

* chore: lint and minor fixes

Signed-off-by: mikeee <hey@mike.ee>

* chore: improve readability+tests and implement context method

Signed-off-by: mikeee <hey@mike.ee>

* test: add nil coverage

Signed-off-by: mikeee <hey@mike.ee>

* feat: workflow implementation wip

Signed-off-by: mikeee <hey@mike.ee>

* chore: add missing actor, configuration and workflow runners for validation

Signed-off-by: mikeee <hey@mike.ee>

* chore: lint

Signed-off-by: mikeee <hey@mike.ee>

* fix: missing formatting directives

Signed-off-by: mikeee <hey@mike.ee>

* feat: implement wf state

Signed-off-by: mikeee <hey@mike.ee>

* feat: add workflow management

Signed-off-by: mikeee <hey@mike.ee>

* chore: fix direct proto field references and general lint

Signed-off-by: mikeee <hey@mike.ee>

* fix: correct states

Signed-off-by: mikeee <hey@mike.ee>

* fix: refactor workflow contexts

Signed-off-by: mikeee <hey@mike.ee>

* fix: increase verbosity and move channel

Signed-off-by: mikeee <hey@mike.ee>

* fix: implement full workflow validation

Signed-off-by: mikeee <hey@mike.ee>

* fix: add dapr-app-id to example

Signed-off-by: mikeee <hey@mike.ee>

* fix: set endpoint

Signed-off-by: mikeee <hey@mike.ee>

* chore: revert actor mod change

Signed-off-by: mikeee <hey@mike.ee>

* chore: revert sum addition

Signed-off-by: mikeee <hey@mike.ee>

* fix: wrap wf management set authtoken in context

Signed-off-by: mikeee <hey@mike.ee>

* fix: migrate to dapr builtin sdk client

Signed-off-by: mikeee <hey@mike.ee>

* fix: correct runtime testing logic and lint
The runtime creation should never be successful in test

Signed-off-by: mikeee <hey@mike.ee>

* fix: implement delayed cancellation

Signed-off-by: mikeee <hey@mike.ee>

* fix(minor): rename getDecorator to getFunctionName

Signed-off-by: mikeee <hey@mike.ee>

* fix: remove alpha workflow

Signed-off-by: mikeee <hey@mike.ee>

* fix(validation): remove redundant result line

Signed-off-by: mikeee <hey@mike.ee>

* feat: initial wfclient implementation

Signed-off-by: mikeee <hey@mike.ee>

* fix: remove redundant closer and fix comparison

Signed-off-by: mikeee <hey@mike.ee>

* tests: improve unit test coverage

Signed-off-by: mikeee <hey@mike.ee>

* fix: cleanup

Signed-off-by: mikeee <hey@mike.ee>

* fix: wording change

Co-authored-by: Chris Gillum <cgillum@gmail.com>
Signed-off-by: mikeee <hey@mike.ee>

* fix: wording change

Co-authored-by: Chris Gillum <cgillum@gmail.com>
Signed-off-by: mikeee <hey@mike.ee>

* chore: bump durabletask-go and deps

Signed-off-by: mikeee <hey@mike.ee>

* chore: add copyright

Signed-off-by: mikeee <hey@mike.ee>

* fix: refactor from runtime to worker and other minor changes

Signed-off-by: mikeee <hey@mike.ee>

* fix: update worker tests

Signed-off-by: mikeee <hey@mike.ee>

* fix: remove workflow component requirement and return worker error

Signed-off-by: mikeee <hey@mike.ee>

* fix: reason field validation removed

Signed-off-by: mikeee <hey@mike.ee>

* fix: remove reason tests

Signed-off-by: mikeee <hey@mike.ee>

* refactoring

Signed-off-by: mikeee <hey@mike.ee>

* fix: inputs

Signed-off-by: mikeee <hey@mike.ee>

* tests: add coverage to activity options

Signed-off-by: mikeee <hey@mike.ee>

* feat: add worker options

Signed-off-by: mikeee <hey@mike.ee>

* fix: remove unused logger

Signed-off-by: mikeee <hey@mike.ee>

* feat: add client options and testing

Signed-off-by: mikeee <hey@mike.ee>

* feat: decouple metadata

Signed-off-by: mikeee <hey@mike.ee>

* chore: remove unused client interface

Signed-off-by: mikeee <hey@mike.ee>

* chore: update tests

Signed-off-by: mikeee <hey@mike.ee>

* chore: lint

Signed-off-by: mikeee <hey@mike.ee>

* test: improve coverage

Signed-off-by: mikeee <hey@mike.ee>

* tests: improve unit coverage

Signed-off-by: mikeee <hey@mike.ee>

* feat: initial workflow

Signed-off-by: mikeee <hey@mike.ee>

* test: add activity context test for input

Signed-off-by: mikeee <hey@mike.ee>

* test: add context texts

Signed-off-by: mikeee <hey@mike.ee>

* fix/test: identify anonymous functions and add tests to runtime

Signed-off-by: mikeee <hey@mike.ee>

* chore: lint and minor fixes

Signed-off-by: mikeee <hey@mike.ee>

* chore: improve readability+tests and implement context method

Signed-off-by: mikeee <hey@mike.ee>

* test: add nil coverage

Signed-off-by: mikeee <hey@mike.ee>

* feat: workflow implementation wip

Signed-off-by: mikeee <hey@mike.ee>

* chore: add missing actor, configuration and workflow runners for validation

Signed-off-by: mikeee <hey@mike.ee>

* chore: lint

Signed-off-by: mikeee <hey@mike.ee>

* fix: missing formatting directives

Signed-off-by: mikeee <hey@mike.ee>

* feat: implement wf state

Signed-off-by: mikeee <hey@mike.ee>

* feat: add workflow management

Signed-off-by: mikeee <hey@mike.ee>

* chore: fix direct proto field references and general lint

Signed-off-by: mikeee <hey@mike.ee>

* fix: correct states

Signed-off-by: mikeee <hey@mike.ee>

* fix: refactor workflow contexts

Signed-off-by: mikeee <hey@mike.ee>

* fix: increase verbosity and move channel

Signed-off-by: mikeee <hey@mike.ee>

* fix: implement full workflow validation

Signed-off-by: mikeee <hey@mike.ee>

* fix: add dapr-app-id to example

Signed-off-by: mikeee <hey@mike.ee>

* fix: set endpoint

Signed-off-by: mikeee <hey@mike.ee>

* chore: revert actor mod change

Signed-off-by: mikeee <hey@mike.ee>

* chore: revert sum addition

Signed-off-by: mikeee <hey@mike.ee>

* fix: wrap wf management set authtoken in context

Signed-off-by: mikeee <hey@mike.ee>

* fix: migrate to dapr builtin sdk client

Signed-off-by: mikeee <hey@mike.ee>

* fix: correct runtime testing logic and lint
The runtime creation should never be successful in test

Signed-off-by: mikeee <hey@mike.ee>

* fix: implement delayed cancellation

Signed-off-by: mikeee <hey@mike.ee>

* fix(minor): rename getDecorator to getFunctionName

Signed-off-by: mikeee <hey@mike.ee>

* fix: remove alpha workflow

Signed-off-by: mikeee <hey@mike.ee>

* fix(validation): remove redundant result line

Signed-off-by: mikeee <hey@mike.ee>

* feat: initial wfclient implementation

Signed-off-by: mikeee <hey@mike.ee>

* fix: remove redundant closer and fix comparison

Signed-off-by: mikeee <hey@mike.ee>

* tests: improve unit test coverage

Signed-off-by: mikeee <hey@mike.ee>

* fix: cleanup

Signed-off-by: mikeee <hey@mike.ee>

* fix: wording change

Co-authored-by: Chris Gillum <cgillum@gmail.com>
Signed-off-by: mikeee <hey@mike.ee>

* fix: wording change

Co-authored-by: Chris Gillum <cgillum@gmail.com>
Signed-off-by: mikeee <hey@mike.ee>

* chore: bump durabletask-go and deps

Signed-off-by: mikeee <hey@mike.ee>

* chore: add copyright

Signed-off-by: mikeee <hey@mike.ee>

* fix: refactor from runtime to worker and other minor changes

Signed-off-by: mikeee <hey@mike.ee>

* fix: update worker tests

Signed-off-by: mikeee <hey@mike.ee>

* fix: remove workflow component requirement and return worker error

Signed-off-by: mikeee <hey@mike.ee>

* fix: reason field validation removed

Signed-off-by: mikeee <hey@mike.ee>

* fix: remove reason tests

Signed-off-by: mikeee <hey@mike.ee>

* refactoring

Signed-off-by: mikeee <hey@mike.ee>

* fix: inputs

Signed-off-by: mikeee <hey@mike.ee>

* tests: add coverage to activity options

Signed-off-by: mikeee <hey@mike.ee>

* feat: add worker options

Signed-off-by: mikeee <hey@mike.ee>

* fix: remove unused logger

Signed-off-by: mikeee <hey@mike.ee>

* feat: add client options and testing

Signed-off-by: mikeee <hey@mike.ee>

* feat: decouple metadata

Signed-off-by: mikeee <hey@mike.ee>

* chore: remove unused client interface

Signed-off-by: mikeee <hey@mike.ee>

* chore: update tests

Signed-off-by: mikeee <hey@mike.ee>

* chore: lint

Signed-off-by: mikeee <hey@mike.ee>

* test: improve coverage

Signed-off-by: mikeee <hey@mike.ee>

* tests: improve unit coverage

Signed-off-by: mikeee <hey@mike.ee>

* fix: implement code review suggestions/refactor and gracefully handle errors

Signed-off-by: mikeee <hey@mike.ee>

* fix: innerfailure handling

Signed-off-by: mikeee <hey@mike.ee>

* docs: add docs to public methods and functions

Signed-off-by: mikeee <hey@mike.ee>

* implements correction

Co-authored-by: Chris Gillum <cgillum@gmail.com>
Signed-off-by: mikeee <hey@mike.ee>

* change typecast assertion

Signed-off-by: mikeee <hey@mike.ee>

* improve clarity of notes

Signed-off-by: mikeee <hey@mike.ee>

* fix mod issues from rebasing interactively on github

Signed-off-by: mikeee <hey@mike.ee>

* implement suggestions from review

- task invoke documentation
- refactor type assertion for startworkflowbeta1

Signed-off-by: mikeee <hey@mike.ee>

* remoove unused definition

Signed-off-by: mikeee <hey@mike.ee>

* fix mod

Signed-off-by: mikeee <hey@mike.ee>

---------

Signed-off-by: mikeee <hey@mike.ee>
Co-authored-by: Chris Gillum <cgillum@gmail.com>
2024-02-09 07:32:36 -08:00
Fabian Martinez 4585a36efd
refactor setting of api token (#502)
* refactor setting of api token

Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com>

* fix breaking change

Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com>

* fix test build

Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com>

* typo

Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com>

---------

Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com>
2024-01-29 17:24:12 -08:00
Josh van Leeuwen 224a159b98
Adds `DAPR_GRPC_ENPOINT` support to client (#475)
* Adds `DAPR_GRPC_ENPOINT` support to client

PR adds `DAPR_GRPC_ENPOINT` environment variable support to client.

Address parser respects http[s] schemes, and TLS query options, as per
[0008-S-sidecar-endpoint-tls.md](https://github.com/dapr/proposals/blob/main/0008-S-sidecar-endpoint-tls.md).

`DAPR_GRPC_ENDPONT` takes precedence over `DAPR_GRPC_PORT`.

Signed-off-by: joshvanl <me@joshvanl.dev>

* Remove errors.Join to have compatibility with Go 1.19

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
2023-12-01 10:19:56 -08:00
Cassie Coyle ae8becfcd3
add note on unsubscribeConfiguration being deprecated (#457)
* add note on unsubscribeConfiguration being deprecated

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Update client/client.go

Co-authored-by: Josh van Leeuwen <me@joshvanl.dev>
Signed-off-by: Cassie Coyle <cassie.i.coyle@gmail.com>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Co-authored-by: Josh van Leeuwen <me@joshvanl.dev>
2023-11-06 09:54:47 +08:00
Alessandro (Ale) Segala 87bbb8cd69
Updates pinned runtime (#469)
This is needed in components-contrib as we cannot pin an updated runtime in cert tests without an updated Go SDK, due to a complex circular dependency

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-11-01 20:11:49 -07:00
Alessandro (Ale) Segala 69e788045d
Remove deprecated method RenameActorReminder (#466)
Fixes #465

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-10-13 20:26:04 -07:00
Mike 5779353f7a
migrate protos (#439)
* remove clean command for protos

Signed-off-by: mikeee <hey@mike.ee>

* delete internal protos

Signed-off-by: mikeee <hey@mike.ee>

* migrate refs to 1.11.1-rc.2

Signed-off-by: mikeee <hey@mike.ee>

* migrate metadata pb import

Signed-off-by: mikeee <hey@mike.ee>

* bump imports (dapr 1.12.0-rc.4)

Signed-off-by: mikeee <hey@mike.ee>

* fix wait test to allow more than one "client"

Signed-off-by: mikeee <hey@mike.ee>

---------

Signed-off-by: mikeee <hey@mike.ee>
2023-09-26 09:20:08 -07:00
Mike 5e2f457f63
Implement metadata api access to the sidecar (#442)
* Add metadata grpc interface

Signed-off-by: mikeee <hey@mike.ee>

* use errors package

Signed-off-by: mikeee <hey@mike.ee>

* remove allocations and explicitly populate returns

Signed-off-by: mikeee <hey@mike.ee>

* remove examples

Signed-off-by: mikeee <hey@mike.ee>

* lint

Signed-off-by: mikeee <hey@mike.ee>

---------

Signed-off-by: mikeee <hey@mike.ee>
2023-09-11 08:42:44 -07:00
Jabar Asadi 04dc71fc57
chore: update NewClientWithAddressContext doc block (#417)
Signed-off-by: Jabar Asadi <jasadi@d2iq.com>
2023-07-06 06:10:20 -07:00
hunter007 d2cbfe3ce5
Fix useragent to 'dapr-sdk-go/v1.8.0' (#421)
* Upadte version tag

Signed-off-by: hunter007 <wentao79@gmail.com>

* Fix: trim blank in SDKVersion

Signed-off-by: hunter007 <wentao79@gmail.com>

* FIx

Signed-off-by: hunter007 <wentao79@gmail.com>

---------

Signed-off-by: hunter007 <wentao79@gmail.com>
2023-07-06 06:08:37 -07:00
Alessandro (Ale) Segala 92c23df717
[Crypto] Implement support for high-level crypto APIs (#387)
* Updated generated protos

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

* Added encrypt method

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

* Add Decrypt method

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

* Working on tests

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

* Added unit tests

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

* Sync protos

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

* Updated protos

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

* 💄

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

---------

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-05-26 07:58:35 -07:00
Taction 9d3e975bc9
use lock instead of once to create default client (#341)
Signed-off-by: zhangchao <zchao9100@gmail.com>
2023-04-27 15:34:22 -07:00
Shivam Kumar 99dc3e31d5
update config subscribe method (#389)
Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
2023-04-27 15:07:16 -07:00
Shubham Sharma b48e8ade5b
Add support for bulk publish (#384)
* Initial implementation

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

* Add a response type and more tests

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

* Change logic and add more tests

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

* Add example

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

* Add docs

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

* Fix lint

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

* gofumpt

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

---------

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
2023-03-31 14:57:57 +08:00
Josh van Leeuwen 0cc2c4ce7a
Create `xxxContext` functions for ones which are missing a caller context. (#358)
* Adds context to rest of funcs, so context can always be propagated.

Signed-off-by: joshvanl <me@joshvanl.dev>

* Adds `//nolint:interfacebloat` to StateManager interface due to new
`xxxContext` methods.

Signed-off-by: joshvanl <me@joshvanl.dev>

* Use separate interface for structs with context funcs

Signed-off-by: joshvanl <me@joshvanl.dev>

* Adds more locks to actor functions

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
2023-03-29 07:40:51 -07:00
Alessandro (Ale) Segala c5377994aa
Various fixes and cleanups (#346)
* Various fixed and cleanups

1. Fixed SDK not compiling and tests failing
2. Increased minimum Go version to 1.18
3. Removed `github.com/pkg/errors` and `go.uber.org/atomic` - replaced with the standard library instead (the old packages have been added to the "depguard" linter)
4. Upgraded all dependencies
5. Upgraded golangci-lint to support Go 1.18+

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

* Do not wrap error if nil

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

* Run CI on Go 1.18 and 1.19

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

* Restore compatibility with Go 1.18

Looks like the newer methods were added in Go 1.19 only

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

* Should fix validate_examples CI

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

* Updated (most) deprecated Actions

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

* Fix helm repo

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

* Determine latest Dapr version in a better way

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

* Fix validate.sh

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

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-01-09 10:38:37 -08:00
Alessandro (Ale) Segala 718044ad12
Report SDK version to Dapr as User-Agent (#328)
* Report SDK version to Dapr

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

* Fixed typos

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

* Fixes

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

* 💄

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

* Making the linter happy-maybe

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

* Update linter to support go:embed comments

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

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-12-16 11:16:10 -08:00
Tiago Alves Macambira c2dfec6abf
Add wait() method to block until Sidecar is up. (#329)
* Add wait() method to block until Sidecar is up.

App might depend on sidecar right away. This PR adds a Wait() method to
enable app to wait for sidecar to be up before invoking the first call.

GRPC client creation on Dapr Go SDK is blocking, so waiting for client
readiness  is less of a problem here than on SDKs where client
connection establishment is async.

Closes #287

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Move Wait its own file.

If anything, this will make testing and the change more localized.

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Adding unresponsive TCP and Unix servers and tests

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Remove comments, clean code up

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Remove a bit of code duplication on tests

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Fix Wait and test server setup.

* Multiple state changes can happen for a single GRPC Connection.
  previous code assume a single one and was failing miserably. Fixed.
* The logic for the test server's tear down was lacking. Fixed

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Rename on aux. method

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Add link to gRPC documentation about connectivity semantics

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Fixing lint errors

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Fixing more lint errors

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>
2022-11-02 10:21:15 -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
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
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 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
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
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
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
huazhongming e53d1d8197
Support rename reminder (#251)
Signed-off-by: crazyhzm <crazyhzm@gmail.com>
2022-01-29 10:06:10 +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
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
Dmitry Shmulevich a38be4e38b
replace license headers (#232)
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2021-12-14 12:06:12 -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
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
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
Long Dai de5cf935fb
ci: standard linter config (#199)
Signed-off-by: Long <long0dai@foxmail.com>
2021-09-22 11:02:52 -07:00
yellow chicks b6ac9208a7
feat(state): SaveState expose StateOptions (#160)
* optimize: state consistency from strong to eventual

* feat(state): SaveState expose StateOptions

* Update state.go

Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2021-05-04 09:08:17 -07:00
Hugome 562562aaef
feat: add shutdown api (#151) 2021-03-25 14:45:54 +08:00
Sky/敖小剑 22f00ec23f
add bulk delete state method in client sdk (#139) 2021-02-09 13:55:34 -08:00
Yaron Schneider b972d70edc
add support for etag and bulk secret modifications (#135) 2021-01-25 18:37:46 -08:00
gaoxinge ee170a232a
fix some typo (#131)
* fix some typo

* log format

* remove useless code
2021-01-25 18:15:56 -08:00
Mark Chmarny f2b03d2b4f
adds bulk secret (#126)
* adds bulk secret

* spelling
2020-12-14 17:32:18 -08:00