Skip to content

Commit

Permalink
change ownerID to lockOwner (#301)
Browse files Browse the repository at this point in the history
Signed-off-by: yaron2 <[email protected]>
  • Loading branch information
yaron2 authored Jul 6, 2022
1 parent 0b65cca commit e086ac5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ ctx := context.Background()
store := "my-store" // defined in the component YAML

r, err := testClient.TryLockAlpha1(ctx, testLockStore, &LockRequest{
OwnerID: "owner1",
LockOwner: "owner1",
ResourceID: "resource1",
ExpiryInSeconds: 5,
})
Expand All @@ -235,7 +235,7 @@ Unlock a lock:

```go
r, err := testClient.UnlockAlpha1(ctx, testLockStore, &UnlockRequest{
OwnerID: "owner1",
LockOwner: "owner1",
ResourceID: "resource1",
})
```
Expand Down
8 changes: 4 additions & 4 deletions client/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ import (
// LockRequest is the lock request object.
type LockRequest struct {
ResourceID string
OwnerID string
LockOwner string
ExpiryInSeconds int32
}

// UnlockRequest is the unlock request object.
type UnlockRequest struct {
ResourceID string
OwnerID string
LockOwner string
}

// LockResponse is the lock operation response object.
Expand All @@ -57,7 +57,7 @@ func (c *GRPCClient) TryLockAlpha1(ctx context.Context, storeName string, reques

req := pb.TryLockRequest{
ResourceId: request.ResourceID,
LockOwner: request.OwnerID,
LockOwner: request.LockOwner,
ExpiryInSeconds: request.ExpiryInSeconds,
StoreName: storeName,
}
Expand All @@ -84,7 +84,7 @@ func (c *GRPCClient) UnlockAlpha1(ctx context.Context, storeName string, request

req := pb.UnlockRequest{
ResourceId: request.ResourceID,
LockOwner: request.OwnerID,
LockOwner: request.LockOwner,
StoreName: storeName,
}

Expand Down
6 changes: 3 additions & 3 deletions client/lock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestLock(t *testing.T) {

t.Run("try lock", func(t *testing.T) {
r, err := testClient.TryLockAlpha1(ctx, testLockStore, &LockRequest{
OwnerID: "owner1",
LockOwner: "owner1",
ResourceID: "resource1",
ExpiryInSeconds: 5,
})
Expand All @@ -54,7 +54,7 @@ func TestLock(t *testing.T) {

t.Run("unlock invalid store name", func(t *testing.T) {
r, err := testClient.UnlockAlpha1(ctx, "", &UnlockRequest{
OwnerID: "owner1",
LockOwner: "owner1",
ResourceID: "resource1",
})
assert.Nil(t, r)
Expand All @@ -69,7 +69,7 @@ func TestLock(t *testing.T) {

t.Run("unlock", func(t *testing.T) {
r, err := testClient.UnlockAlpha1(ctx, testLockStore, &UnlockRequest{
OwnerID: "owner1",
LockOwner: "owner1",
ResourceID: "resource1",
})
assert.NotNil(t, r)
Expand Down

0 comments on commit e086ac5

Please sign in to comment.