Fork to maintain patches against the official gitea for https://code.ceondo.com https://github.com/go-gitea/gitea

lfs_lock.go 2.0KB

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