Skip to content

Commit ce7ba4e

Browse files
theonefxcicoyleyaron2
authored
add metadata prop to lock api (#3812)
Signed-off-by: theonefx <[email protected]> Co-authored-by: Cassie Coyle <[email protected]> Co-authored-by: Yaron Schneider <[email protected]>
1 parent 685ab52 commit ce7ba4e

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

lock/requests.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ package lock
1515

1616
// TryLockRequest is a lock acquire request.
1717
type TryLockRequest struct {
18-
ResourceID string `json:"resourceId"`
19-
LockOwner string `json:"lockOwner"`
20-
ExpiryInSeconds int32 `json:"expiryInSeconds"`
18+
ResourceID string `json:"resourceId"`
19+
LockOwner string `json:"lockOwner"`
20+
ExpiryInSeconds int32 `json:"expiryInSeconds"`
21+
Metadata map[string]string `json:"metadata"`
2122
}
2223

2324
// UnlockRequest is a lock release request.
2425
type UnlockRequest struct {
25-
ResourceID string `json:"resourceId"`
26-
LockOwner string `json:"lockOwner"`
26+
ResourceID string `json:"resourceId"`
27+
LockOwner string `json:"lockOwner"`
28+
Metadata map[string]string `json:"metadata"`
2729
}

lock/responses.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ package lock
1515

1616
// Lock acquire request was successful or not.
1717
type TryLockResponse struct {
18-
Success bool `json:"success"`
18+
Success bool `json:"success"`
19+
Metadata map[string]string `json:"metadata"`
1920
}
2021

2122
// Status when releasing the lock.
2223
type UnlockResponse struct {
23-
Status Status `json:"status"`
24+
Status Status `json:"status"`
25+
Metadata map[string]string `json:"metadata"`
2426
}
2527

2628
type Status int32

0 commit comments

Comments
 (0)