summaryrefslogtreecommitdiffstats
path: root/modules/structs/lfs_lock.go
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-10-18 20:33:49 +0200
committerDaniel Baumann <daniel@debian.org>2024-10-18 20:33:49 +0200
commitdd136858f1ea40ad3c94191d647487fa4f31926c (patch)
tree58fec94a7b2a12510c9664b21793f1ed560c6518 /modules/structs/lfs_lock.go
parentInitial commit. (diff)
downloadforgejo-dd136858f1ea40ad3c94191d647487fa4f31926c.tar.xz
forgejo-dd136858f1ea40ad3c94191d647487fa4f31926c.zip
Adding upstream version 9.0.0.HEADupstream/9.0.0upstreamdebian
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'modules/structs/lfs_lock.go')
-rw-r--r--modules/structs/lfs_lock.go64
1 files changed, 64 insertions, 0 deletions
diff --git a/modules/structs/lfs_lock.go b/modules/structs/lfs_lock.go
new file mode 100644
index 0000000..6b4c0bc
--- /dev/null
+++ b/modules/structs/lfs_lock.go
@@ -0,0 +1,64 @@
+// Copyright 2017 The Gitea Authors. All rights reserved.
+// SPDX-License-Identifier: MIT
+
+package structs
+
+import (
+ "time"
+)
+
+// LFSLock represent a lock
+// for use with the locks API.
+type LFSLock struct {
+ ID string `json:"id"`
+ Path string `json:"path"`
+ LockedAt time.Time `json:"locked_at"`
+ Owner *LFSLockOwner `json:"owner"`
+}
+
+// LFSLockOwner represent a lock owner
+// for use with the locks API.
+type LFSLockOwner struct {
+ Name string `json:"name"`
+}
+
+// LFSLockRequest contains the path of the lock to create
+// https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#create-lock
+type LFSLockRequest struct {
+ Path string `json:"path"`
+}
+
+// LFSLockResponse represent a lock created
+// https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#create-lock
+type LFSLockResponse struct {
+ Lock *LFSLock `json:"lock"`
+}
+
+// LFSLockList represent a list of lock requested
+// https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#list-locks
+type LFSLockList struct {
+ Locks []*LFSLock `json:"locks"`
+ Next string `json:"next_cursor,omitempty"`
+}
+
+// LFSLockListVerify represent a list of lock verification requested
+// https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#list-locks-for-verification
+type LFSLockListVerify struct {
+ Ours []*LFSLock `json:"ours"`
+ Theirs []*LFSLock `json:"theirs"`
+ Next string `json:"next_cursor,omitempty"`
+}
+
+// LFSLockError contains information on the error that occurs
+type LFSLockError struct {
+ Message string `json:"message"`
+ Lock *LFSLock `json:"lock,omitempty"`
+ Documentation string `json:"documentation_url,omitempty"`
+ RequestID string `json:"request_id,omitempty"`
+}
+
+// LFSLockDeleteRequest contains params of a delete request
+// https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#delete-lock
+type LFSLockDeleteRequest struct {
+ Force bool `json:"force"`
+}