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>
* 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>
* 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>
* 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>
* 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>
* update GetBulkState method: add metedata, change return struct to BulkStateItem
* generate code from dapr proto files; support metadata in get response
* update for code review
* http service implementation
* http coverage
* common serving interface
* multi pubsub support
* multi-pubsub serving
* ensures unique componennt/topic
* cleaned samples in docs
* cleaned up examples in callback docs
* removes Parallel from callback tests
* multi-pupsub support
* updated tests for empty pubsub data
* cleaned up example client
* header parsing in HTTP per issue 1894 in dapr
* refactored client binding
* refactored service invoke
* updated client and serving docs
* removed v0.9 from makefile action descr
* renamed based on PR review
* updated names globally
* multi pubsub support
* multi-pubsub serving
* ensures unique componennt/topic
* cleaned samples in docs
* cleaned up examples in callback docs
* removes Parallel from callback tests
* clarified the comments on ListTopicSubscriptions
* clarified validation error messages
* removed in data requirement
* WIP: server
* gRPC server implementaiton
* http serving
* grpc ports as string vs int
* bump tag
* adds ctx, fixes linting errors
* v0.8.2 bump
* fixes serving options
* cleans up cloud events in gttp serving
* v0.8.4 version bump
* uses http method constant
* adds grpc serving tests
* pubsub evnet as bytes
* adds tests, seperate payload between http, grpc
* refactored names, tests
* fixes release names
* fixes versoin number
* http invoke test, grpc invoke params
* makefile updates
* readme updates, fixes grpc to http invocations
* readme updates
* comments, refactored http service
* more serving tests
* more client tests
* test verbocity
* fixes grpc error serializtion error
* adds serving to readme
* code formatting
* adds support for TypeUrl in case of a proto conten
* added binding in http service
* cron in grpc example
* single interface for grpc and http sdks
* normalized serving interfaces across http and grpc
* unit, rest api tests for grpc, html serving
* updated tests
* resolved master conflicts
* changes from @youngbupark review
* overloaded AddTopicEventHandler for ease of use
* updated to go 1.15, dependancies
* updated actions to go 1.15
* service test coverage
* readme and release version updates
* makefile flag options for dapr v0.9
* serving to grpc package for ease of http imp