Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store interface { // Init this component. InitLockStore(ctx context.Context, metadata Metadata) error // TryLock tries to acquire a lock. TryLock(ctx context.Context, req *TryLockRequest) (*TryLockResponse, error) // Unlock tries to release a lock. Unlock(ctx context.Context, req *UnlockRequest) (*UnlockResponse, error) // GetComponentMetadata returns information on the component's metadata. GetComponentMetadata() map[string]string }
type TryLockRequest ¶
type TryLockRequest struct { ResourceID string `json:"resourceId"` LockOwner string `json:"lockOwner"` ExpiryInSeconds int32 `json:"expiryInSeconds"` }
TryLockRequest is a lock acquire request.
type TryLockResponse ¶
type TryLockResponse struct {
Success bool `json:"success"`
}
Lock acquire request was successful or not.
type UnlockRequest ¶
type UnlockRequest struct { ResourceID string `json:"resourceId"` LockOwner string `json:"lockOwner"` }
UnlockRequest is a lock release request.
type UnlockResponse ¶
type UnlockResponse struct {
Status Status `json:"status"`
}
Status when releasing the lock.
Click to show internal directories.
Click to hide internal directories.