You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lfs_lock.go 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package structs
  4. import (
  5. "time"
  6. )
  7. // LFSLock represent a lock
  8. // for use with the locks API.
  9. type LFSLock struct {
  10. ID string `json:"id"`
  11. Path string `json:"path"`
  12. LockedAt time.Time `json:"locked_at"`
  13. Owner *LFSLockOwner `json:"owner"`
  14. }
  15. // LFSLockOwner represent a lock owner
  16. // for use with the locks API.
  17. type LFSLockOwner struct {
  18. Name string `json:"name"`
  19. }
  20. // LFSLockRequest contains the path of the lock to create
  21. // https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#create-lock
  22. type LFSLockRequest struct {
  23. Path string `json:"path"`
  24. }
  25. // LFSLockResponse represent a lock created
  26. // https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#create-lock
  27. type LFSLockResponse struct {
  28. Lock *LFSLock `json:"lock"`
  29. }
  30. // LFSLockList represent a list of lock requested
  31. // https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#list-locks
  32. type LFSLockList struct {
  33. Locks []*LFSLock `json:"locks"`
  34. Next string `json:"next_cursor,omitempty"`
  35. }
  36. // LFSLockListVerify represent a list of lock verification requested
  37. // https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#list-locks-for-verification
  38. type LFSLockListVerify struct {
  39. Ours []*LFSLock `json:"ours"`
  40. Theirs []*LFSLock `json:"theirs"`
  41. Next string `json:"next_cursor,omitempty"`
  42. }
  43. // LFSLockError contains information on the error that occurs
  44. type LFSLockError struct {
  45. Message string `json:"message"`
  46. Lock *LFSLock `json:"lock,omitempty"`
  47. Documentation string `json:"documentation_url,omitempty"`
  48. RequestID string `json:"request_id,omitempty"`
  49. }
  50. // LFSLockDeleteRequest contains params of a delete request
  51. // https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#delete-lock
  52. type LFSLockDeleteRequest struct {
  53. Force bool `json:"force"`
  54. }