Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Unix domain socket support #206

Merged
merged 4 commits into from Jan 13, 2022
Merged

add Unix domain socket support #206

merged 4 commits into from Jan 13, 2022

Conversation

daixiang0
Copy link
Member

Fix #198

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

@daixiang0 daixiang0 requested a review from a team as a code owner September 27, 2021 07:50
@codecov
Copy link

codecov bot commented Sep 27, 2021

Codecov Report

Merging #206 (94a2632) into main (8a7a61b) will increase coverage by 0.58%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #206      +/-   ##
==========================================
+ Coverage   63.14%   63.72%   +0.58%     
==========================================
  Files          23       23              
  Lines        1305     1315      +10     
==========================================
+ Hits          824      838      +14     
+ Misses        405      402       -3     
+ Partials       76       75       -1     
Impacted Files Coverage Δ
client/client.go 71.87% <80.00%> (+12.61%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a7a61b...94a2632. Read the comment docs.

daixiang0 and others added 3 commits November 2, 2021 14:29
Signed-off-by: Long <long0dai@foxmail.com>
Signed-off-by: Long <long.dai@intel.com>
@daixiang0
Copy link
Member Author

@artursouza @yaron2 please review.

First, the app instantiates Dapr client:

```go
client, err := dapr.NewClientWithSocket(socket)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why duplicating the whole example just for socket connection?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are here:

6d5
<       "os"
16c15
<       daprPort       = "3500"
---
>       socket         = "/tmp/dapr-order-app-grpc.socket"
19,26d17
< var port string
<
< func init() {
<       if port = os.Getenv("DAPR_GRPC_PORT"); len(port) == 0 {
<               port = daprPort
<       }
< }
<
36c27
<       client, err := dapr.NewClientWithPort(port)
---
>       client, err := dapr.NewClientWithSocket(socket)

Use patch in example is not common I think.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @yaron2

@daixiang0
Copy link
Member Author

@yaron2 ping

@daixiang0 daixiang0 added this to the 1.4 milestone Dec 29, 2021
@yaron2 yaron2 merged commit f912500 into dapr:main Jan 13, 2022
@daixiang0 daixiang0 deleted the uds branch January 19, 2022 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support domain socket
3 participants