code.gitea.io/gitea@v1.19.3/modules/structs/lfs_lock.go (about)

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