change ownerID to lockOwner (#301)

Signed-off-by: yaron2 <schneider.yaron@live.com>
This commit is contained in:
Yaron Schneider 2022-07-06 12:34:38 -07:00 committed by GitHub
parent 0b65cca826
commit e086ac59a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -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,
})
@ -235,7 +235,7 @@ Unlock a lock:
```go
r, err := testClient.UnlockAlpha1(ctx, testLockStore, &UnlockRequest{
OwnerID: "owner1",
LockOwner: "owner1",
ResourceID: "resource1",
})
```

View File

@ -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.
@ -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,
}
@ -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,
}

View File

@ -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,
})
@ -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)
@ -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)