Commit Graph

17 Commits

Author SHA1 Message Date
Rafael Câmara c61b15d5b1
Remove unused using statements. (#1313)
Signed-off-by: Rafael Camara <rafaelcamarac@gmail.com>
2024-10-24 17:00:09 -05:00
Dmitry Shmulevich 0c9d6a45c8
replaced license headers (#802)
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2021-12-10 13:39:06 -08:00
vinayada1 a2ed096b79
API to set DAPR_API_TOKEN (#558)
* API to set DAPR_API_TOKEN

Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2021-01-27 13:39:44 -08:00
Ryan Nowak 8a7bac13b3
Add IDisposable to DaprClient (#563)
Fixes: #559

This change adds disposable support to DaprClient, and updates samples
to dispose it.

I didn't update tests because there are literally hundreds of
non-find-and-replacable cases, and we're not actually doing networking
in our tests so it won't cause an issue.
2021-01-26 15:45:01 -08:00
Ryan Nowak 9748ca0a82
Simplify service invocation APIs (#555)
Fixes: #549

This change mixes up the service invocation APIs to reflect some changes
that are coming down the pipe in dapr/dapr#2683.

We're now using HTTP's semantics and JSON for the main functionality in
`InvokeMethodAsync`. This means that the error handling is simplified
and base on HTTP's status codes rather than trying to abstract over HTTP
and gRPC's different error models. This also means that we're free to
expose HttpRequestMessage and related types in the API because it's no
longer an abstraction.

You can still use `InvokeMethodAsync` to invoke gRPC services, but you
will get a status code in the response, and it will expect JSON, etc,
similar to how gRPC gateway works.

In addition to that we're added `InvokeMethodGrpcAsync` for cases where
you really want *gRPC's* semantics. These methods do Protobuf
serialization, as is a natural choice for gRPC. I do not recommend using
this approach to invoke HTTP services.

---

I also mad updates and improvments to various infrastructure where
necessary (like InvocationException). Also, the gRPC sample in the repo
now uses the new `InvokeMethodGrpcAsync` APIs.
2021-01-22 16:28:20 -08:00
Ryan Nowak f6aec35b9b
Add HttpClient support for Dapr service invocation (#544)
- Adds a new message handler for HttpClient interop
- Adds an easy way to create HttpClient instances
- A bunch of sample cleanup/polish/simplification

The main thing here is the added ability to interop with HttpClient. We'll be making some future changes to the service invocation APIs in DaprClient to address dapr/dapr#2342 since that issues greatly simplifies the interface we're dealing with.

Fixes: #526
2021-01-17 16:22:45 -08:00
Ryan Nowak 0d772db882
Replace IDictionary<> with IReadOnlyDictionary<> (#541)
Fixes: #395

This change uses the IReadOnlyDictionary<> interface type where
possible, in particularly where we accept metadata. This allows the use
of the immutable collection types as parameters, as well as communicates
the contract - the SDK will read the metadata but not write to it. This
is helpful, because it communicates clearly to the user that they can
create a shared metadata collection instance and reuse them across
calls.
2021-01-11 14:48:24 -08:00
Sander Molenkamp afc87abe7d
Replace ValueTask with Task (#539) 2021-01-11 10:27:40 -08:00
Per Ökvist 50dec32e8a
state operation overload with meta #412 (#470)
* state operation overload with meta #412

* added metadata to bulk state

* getStateAndEtag with metadata test

* an -> a keyvalue pair

* Added GetBulkStateAsync_ValidateRequest

* update

* update

* removed backup files

* metadata docs

* state store metadata docs

Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2021-01-08 11:45:34 -08:00
Ryan Nowak 776156298e
Apply linting suggestions (#492)
We've had a list of linting-related messages piling up for a while now.
This change bulk-applies these suggestions with usually relate to
simplification or use or newer language features like ??=

The only changes I did manually here are:

    Removing some usage of Task.GetAwaiter().GetResult() where it was
    just laziness
    Removing some dead code in methods and parameters of internal APIs.
2021-01-04 17:35:57 -08:00
vinayada1 4c926c9469
Rich error model (#432)
* add InvokeMethodRawAsync and InvokeMethodWithResponseAsync
Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2020-10-30 13:59:33 -07:00
Leon Mai bf0354bd39
Add metadata for get/delete state apis (#383)
Co-authored-by: LM <lemai>
2020-09-01 18:27:17 -07:00
Yaron Schneider 6671ab020c
Add bulk get to client (#372)
* Add bulk get to client

* change params, return type, class to struct

* change IList to IReadOnlyList, make parallelism nullable

* change GetBulkItem to BulkStateItem
2020-08-17 09:24:35 -07:00
Aman Bhardwaj 51fc48fb74
Adding & enhancing client apis over gRPC (#244)
* adding IDAprClient interface

* Adding DaprClientBuilder and adding methods for Publish

* updating the method name for publish

* Adding unit tests for publishevent api

* Removing individual clients for publish

* Renaming base class to DaprClient and implementation calss to DparClientGrpc

* Moving State api to grpc and adding helpers to unittest grpc calls.

* More DaprClient logic

* metadata, etag, options, etc are optional

* Revert "metadata, etag, options, etc are optional"

This reverts commit ea5dc12c5d.

* Default params, 2 new Try- methods, overload refactor for InvokeMethodAsync

* Move some classes/enums to different files.  Documentation

* Code refactor and changing tests to use grpc

* Adding tests with state options

* Adding test for getting etag and state

* More refactoring and adding INvokeBinding test

* Fixing tests and tidying up things.

* Updating solutions for renamed project

* Updating projects for rename.

* Oneclient secret (#245)

* ADding Secret Apis

* Using Task for secret

* Format (#242)

* Updating samples.slm

* awaint the call to grpc in common method so that common error handling can be done there.

* Addressing review comments

* fixing test.sln

* updating prod.sln

* Addressing review comments from James.

* Add doc and example for method invocation on http app

* Updating arg validation.

* Updating example.

Co-authored-by: LM <lemai>
Co-authored-by: Carlos Mendible <cmendible@gmail.com>
2020-03-09 20:52:12 -07:00
Shalabh Mohan Shrivastava 5b8a426e7d
Add support in dotnet client sdk to support multi state store support (#207)
* Including state Store name in the APIs to support multi state store scenario in SDK

* correcting the typo in the comment.

* Respective Changes to the tests

* Changes in StateAttribute and Binder classes to support state store name

* Changes in StateEntryModelBinderTests

* StoreName changes in the Integration test app

* fixing build issues

* Fixing integration tests

* Addressing review comments.

* Addressing review comments

* Updating samples to use correct state store name as generated by dapr cli.

Co-authored-by: Aman Bhardwaj <amanbha@users.noreply.github.com>
2020-02-06 09:06:21 -08:00
Ryan Nowak b02aa3f02b Add support for delete operations (#198)
* Add support for delete operations

* Removing extra spaces to fix build break.

Co-authored-by: Aman Bhardwaj <amanbha@users.noreply.github.com>
2020-01-09 09:53:13 -08:00
Aman Bhardwaj 4fb29e44e3
Changing to Dapr.* (#89)
* Changing to Dapr.*

* Update readme.md

* keeping things signed
2019-10-11 13:42:30 -07:00