Debian Codegraph @

locking/api.go

raw symbols SCIP
1 package lockingscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/
2
3 import (
4 "fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/"
5 "net/httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/"
6 "strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/"
7
8 "github.com/git-lfs/git-lfs/v3/errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/"
9 "github.com/git-lfs/git-lfs/v3/gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/"
10 "github.com/git-lfs/git-lfs/v3/lfsapiscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/"
11 "github.com/git-lfs/git-lfs/v3/lfshttpscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/"
12 "github.com/git-lfs/git-lfs/v3/trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/"
13 )
14
15 type lockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClient# interface {
16 Lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClient#Lock.(remote string, lockReq *lockRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockRequest#) (*lockResponsescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockResponse#, int, error)
17 Unlockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClient#Unlock.(ref *gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#, remote, id string, force bool) (*unlockResponsescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockResponse#, int, error)
18 Searchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClient#Search.(remote string, searchReq *lockSearchRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#) (*lockListscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockList#, int, error)
19 SearchVerifiablescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClient#SearchVerifiable.(remote string, vreq *lockVerifiableRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableRequest#) (*lockVerifiableListscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableList#, int, error)
20 }
21
22 type httpLockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/httpLockClient# struct {
23 *lfsapiscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/.Clientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/httpLockClient#Client.
24 }
25
26 type lockRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockRef# struct {
27 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockRef#Name. string `json:"name,omitempty"`
28 }
29
30 // LockRequest encapsulates the payload sent across the API when a client would
31 // like to obtain a lock against a particular path on a given remote.
32 type lockRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockRequest# struct {
33 // Path is the path that the client would like to obtain a lock against.
34 Pathscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockRequest#Path. string `json:"path"`
35 Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockRequest#Ref. *lockRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockRef# `json:"ref,omitempty"`
36 }
37
38 // LockResponse encapsulates the information sent over the API in response to
39 // a `LockRequest`.
40 type lockResponsescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockResponse# struct {
41 // Lock is the Lock that was optionally created in response to the
42 // payload that was sent (see above). If the lock already exists, then
43 // the existing lock is sent in this field instead, and the author of
44 // that lock remains the same, meaning that the client failed to obtain
45 // that lock. An HTTP status of "409 - Conflict" is used here.
46 //
47 // If the lock was unable to be created, this field will hold the
48 // zero-value of Lock and the Err field will provide a more detailed set
49 // of information.
50 //
51 // If an error was experienced in creating this lock, then the
52 // zero-value of Lock should be sent here instead.
53 Lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockResponse#Lock. *Lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/Lock# `json:"lock"`
54
55 // Message is the optional error that was encountered while trying to create
56 // the above lock.
57 Messagescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockResponse#Message. string `json:"message,omitempty"`
58 DocumentationURLscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockResponse#DocumentationURL. string `json:"documentation_url,omitempty"`
59 RequestIDscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockResponse#RequestID. string `json:"request_id,omitempty"`
60 }
61
62 func (c *httpLockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/httpLockClient#) Lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/httpLockClient#Lock().(remote string, lockReq *lockRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockRequest#) (*lockResponsescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockResponse#, int, error) {
63 e := c.Endpointsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#Endpoints..Endpointscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/EndpointFinder#Endpoint.("upload", remote)
64 req, err := c.NewRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#NewRequest().("POST", e, "locks", lockReq)
65 if err != nil {
66 return nil, 0, err
67 }
68
69 req = c.Clientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/httpLockClient#Client..LogRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#LogRequest().(req, "lfs.locks.lock")
70 res, err := c.DoAPIRequestWithAuthscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#DoAPIRequestWithAuth().(remote, req)
71 if err != nil {
72 if res != nil {
73 return nil, res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode., err
74 }
75 return nil, 0, err
76 }
77
78 lockRes := &lockResponsescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockResponse#{}
79 err = lfshttpscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/.DecodeJSONscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/DecodeJSON().(res, lockRes)
80 if err != nil {
81 return nil, res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode., err
82 }
83 if lockRes.Lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockResponse#Lock. == nil && len(lockRes.Messagescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockResponse#Message.) == 0 {
84 return nil, res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode., errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Newscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/New().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("invalid server response"))
85 }
86 return lockRes, res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode., nil
87 }
88
89 // UnlockRequest encapsulates the data sent in an API request to remove a lock.
90 type unlockRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockRequest# struct {
91 // Force determines whether or not the lock should be "forcibly"
92 // unlocked; that is to say whether or not a given individual should be
93 // able to break a different individual's lock.
94 Forcescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockRequest#Force. bool `json:"force"`
95 Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockRequest#Ref. *lockRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockRef# `json:"ref,omitempty"`
96 }
97
98 // UnlockResponse is the result sent back from the API when asked to remove a
99 // lock.
100 type unlockResponsescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockResponse# struct {
101 // Lock is the lock corresponding to the asked-about lock in the
102 // `UnlockPayload` (see above). If no matching lock was found, this
103 // field will take the zero-value of Lock, and Err will be non-nil.
104 Lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockResponse#Lock. *Lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/Lock# `json:"lock"`
105
106 // Message is an optional field which holds any error that was experienced
107 // while removing the lock.
108 Messagescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockResponse#Message. string `json:"message,omitempty"`
109 DocumentationURLscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockResponse#DocumentationURL. string `json:"documentation_url,omitempty"`
110 RequestIDscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockResponse#RequestID. string `json:"request_id,omitempty"`
111 }
112
113 func (c *httpLockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/httpLockClient#) Unlockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/httpLockClient#Unlock().(ref *gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#, remote, id string, force bool) (*unlockResponsescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockResponse#, int, error) {
114 e := c.Endpointsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#Endpoints..Endpointscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/EndpointFinder#Endpoint.("upload", remote)
115 suffix := fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.25.0 fmt/Sprintf().("locks/%s/unlock", id)
116 req, err := c.NewRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#NewRequest().("POST", e, suffix, &unlockRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockRequest#{
117 Forcescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockRequest#Force.: force,
118 Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockRequest#Ref.: &lockRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockRef#{Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockRef#Name.: ref.Refspecscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Refspec().()},
119 })
120 if err != nil {
121 return nil, 0, err
122 }
123
124 req = c.Clientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/httpLockClient#Client..LogRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#LogRequest().(req, "lfs.locks.unlock")
125 res, err := c.DoAPIRequestWithAuthscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#DoAPIRequestWithAuth().(remote, req)
126 if err != nil {
127 if res != nil {
128 return nil, res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode., err
129 }
130 return nil, 0, err
131 }
132
133 unlockRes := &unlockResponsescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockResponse#{}
134 err = lfshttpscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/.DecodeJSONscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/DecodeJSON().(res, unlockRes)
135 if err != nil {
136 return nil, res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode., err
137 }
138 if unlockRes.Lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockResponse#Lock. == nil && len(unlockRes.Messagescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockResponse#Message.) == 0 {
139 return nil, res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode., errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Newscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/New().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("invalid server response"))
140 }
141 return unlockRes, res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode., nil
142 }
143
144 // Filter represents a single qualifier to apply against a set of locks.
145 type lockFilterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockFilter# struct {
146 // Property is the property to search against.
147 // Value is the value that the property must take.
148 Propertyscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockFilter#Property., Valuescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockFilter#Value. string
149 }
150
151 // LockSearchRequest encapsulates the request sent to the server when the client
152 // would like a list of locks that match the given criteria.
153 type lockSearchRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest# struct {
154 // Filters is the set of filters to query against. If the client wishes
155 // to obtain a list of all locks, an empty array should be passed here.
156 Filtersscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#Filters. []lockFilterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockFilter#
157 // Cursor is an optional field used to tell the server which lock was
158 // seen last, if scanning through multiple pages of results.
159 //
160 // Servers must return a list of locks sorted in reverse chronological
161 // order, so the Cursor provides a consistent method of viewing all
162 // locks, even if more were created between two requests.
163 Cursorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#Cursor. string
164 // Limit is the maximum number of locks to return in a single page.
165 Limitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#Limit. int
166
167 Refspecscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#Refspec. string
168 }
169
170 func (r *lockSearchRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#) QueryValuesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#QueryValues().() map[string]string {
171 q := make(map[string]string)
172 for _, filter := range r.Filtersscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#Filters. {
173 q[filter.Propertyscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockFilter#Property.] = filter.Valuescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockFilter#Value.
174 }
175
176 if len(r.Cursorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#Cursor.) > 0 {
177 q["cursor"] = r.Cursorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#Cursor.
178 }
179
180 if r.Limitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#Limit. > 0 {
181 q["limit"] = strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/.Itoascip-go gomod github.com/golang/go/src go1.25.0 strconv/Itoa().(r.Limitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#Limit.)
182 }
183
184 if len(r.Refspecscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#Refspec.) > 0 {
185 q["refspec"] = r.Refspecscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#Refspec.
186 }
187
188 return q
189 }
190
191 // LockList encapsulates a set of Locks.
192 type lockListscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockList# struct {
193 // Locks is the set of locks returned back, typically matching the query
194 // parameters sent in the LockListRequest call. If no locks were matched
195 // from a given query, then `Locks` will be represented as an empty
196 // array.
197 Locksscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockList#Locks. []Lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/Lock# `json:"locks"`
198 // NextCursor returns the Id of the Lock the client should update its
199 // cursor to, if there are multiple pages of results for a particular
200 // `LockListRequest`.
201 NextCursorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockList#NextCursor. string `json:"next_cursor,omitempty"`
202 // Message populates any error that was encountered during the search. If no
203 // error was encountered and the operation was successful, then a value
204 // of nil will be passed here.
205 Messagescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockList#Message. string `json:"message,omitempty"`
206 DocumentationURLscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockList#DocumentationURL. string `json:"documentation_url,omitempty"`
207 RequestIDscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockList#RequestID. string `json:"request_id,omitempty"`
208 }
209
210 func (c *httpLockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/httpLockClient#) Searchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/httpLockClient#Search().(remote string, searchReq *lockSearchRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#) (*lockListscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockList#, int, error) {
211 e := c.Endpointsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#Endpoints..Endpointscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/EndpointFinder#Endpoint.("download", remote)
212 req, err := c.NewRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#NewRequest().("GET", e, "locks", nil)
213 if err != nil {
214 return nil, 0, err
215 }
216
217 q := req.URLscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#URL..Queryscip-go gomod github.com/golang/go/src go1.25.0 `net/url`/URL#Query().()
218 for key, value := range searchReq.QueryValuesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#QueryValues().() {
219 q.Addscip-go gomod github.com/golang/go/src go1.25.0 `net/url`/Values#Add().(key, value)
220 }
221 req.URLscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#URL..RawQueryscip-go gomod github.com/golang/go/src go1.25.0 `net/url`/URL#RawQuery. = q.Encodescip-go gomod github.com/golang/go/src go1.25.0 `net/url`/Values#Encode().()
222
223 req = c.Clientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/httpLockClient#Client..LogRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#LogRequest().(req, "lfs.locks.search")
224 res, err := c.DoAPIRequestWithAuthscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#DoAPIRequestWithAuth().(remote, req)
225 if err != nil {
226 if res != nil {
227 return nil, res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode., err
228 }
229 return nil, 0, err
230 }
231
232 locks := &lockListscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockList#{}
233 if res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode. == httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/.StatusOKscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/StatusOK. {
234 err = lfshttpscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/.DecodeJSONscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/DecodeJSON().(res, locks)
235 }
236
237 return locks, res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode., err
238 }
239
240 // lockVerifiableRequest encapsulates the request sent to the server when the
241 // client would like a list of locks to verify a Git push.
242 type lockVerifiableRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableRequest# struct {
243 Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableRequest#Ref. *lockRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockRef# `json:"ref,omitempty"`
244
245 // Cursor is an optional field used to tell the server which lock was
246 // seen last, if scanning through multiple pages of results.
247 //
248 // Servers must return a list of locks sorted in reverse chronological
249 // order, so the Cursor provides a consistent method of viewing all
250 // locks, even if more were created between two requests.
251 Cursorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableRequest#Cursor. string `json:"cursor,omitempty"`
252 // Limit is the maximum number of locks to return in a single page.
253 Limitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableRequest#Limit. int `json:"limit,omitempty"`
254 }
255
256 // lockVerifiableList encapsulates a set of Locks to verify a Git push.
257 type lockVerifiableListscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableList# struct {
258 // Ours is the set of locks returned back matching filenames that the user
259 // is allowed to edit.
260 Oursscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableList#Ours. []Lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/Lock# `json:"ours"`
261
262 // Their is the set of locks returned back matching filenames that the user
263 // is NOT allowed to edit. Any edits matching these files should reject
264 // the Git push.
265 Theirsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableList#Theirs. []Lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/Lock# `json:"theirs"`
266
267 // NextCursor returns the Id of the Lock the client should update its
268 // cursor to, if there are multiple pages of results for a particular
269 // `LockListRequest`.
270 NextCursorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableList#NextCursor. string `json:"next_cursor,omitempty"`
271 // Message populates any error that was encountered during the search. If no
272 // error was encountered and the operation was successful, then a value
273 // of nil will be passed here.
274 Messagescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableList#Message. string `json:"message,omitempty"`
275 DocumentationURLscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableList#DocumentationURL. string `json:"documentation_url,omitempty"`
276 RequestIDscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableList#RequestID. string `json:"request_id,omitempty"`
277 }
278
279 func (c *httpLockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/httpLockClient#) SearchVerifiablescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/httpLockClient#SearchVerifiable().(remote string, vreq *lockVerifiableRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableRequest#) (*lockVerifiableListscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableList#, int, error) {
280 e := c.Endpointsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#Endpoints..Endpointscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/EndpointFinder#Endpoint.("upload", remote)
281 req, err := c.NewRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#NewRequest().("POST", e, "locks/verify", vreq)
282 if err != nil {
283 return nil, 0, err
284 }
285
286 req = c.Clientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/httpLockClient#Client..LogRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#LogRequest().(req, "lfs.locks.verify")
287 res, err := c.DoAPIRequestWithAuthscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#DoAPIRequestWithAuth().(remote, req)
288 if err != nil {
289 if res != nil {
290 return nil, res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode., err
291 }
292 return nil, 0, err
293 }
294
295 locks := &lockVerifiableListscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableList#{}
296 if res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode. == httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/.StatusOKscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/StatusOK. {
297 err = lfshttpscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/.DecodeJSONscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/DecodeJSON().(res, locks)
298 }
299
300 return locks, res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode., err
301 }
302
303 // User represents the owner of a lock.
304 type Userscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/User# struct {
305 // Name is the name of the individual who would like to obtain the
306 // lock, for instance: "Rick Sanchez".
307 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/User#Name. string `json:"name"`
308 }
309
310 func NewUserscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/NewUser().(name string) *Userscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/User# {
311 return &Userscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/User#{Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/User#Name.: name}
312 }
313
314 // String implements the fmt.Stringer interface.
315 func (u *Userscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/User#) Stringscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/User#String().() string {
316 return u.Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/User#Name.
317 }
318
319 type lockClientInfoscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClientInfo# struct {
320 remotescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClientInfo#remote. string
321 operationscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClientInfo#operation. string
322 }
323
324 type genericLockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient# struct {
325 clientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#client. *lfsapiscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/.Clientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#
326 lclientsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#lclients. map[lockClientInfoscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClientInfo#]lockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClient#
327 }
328
329 func newGenericLockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/newGenericLockClient().(client *lfsapiscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/.Clientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#) *genericLockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient# {
330 return &genericLockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#{
331 clientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#client.: client,
332 lclientsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#lclients.: make(map[lockClientInfoscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClientInfo#]lockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClient#),
333 }
334 }
335
336 func (c *genericLockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#) getClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#getClient().(remote, operation string) lockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClient# {
337 info := lockClientInfoscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClientInfo#{
338 remotescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClientInfo#remote.: remote,
339 operationscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClientInfo#operation.: operation,
340 }
341 if client := c.lclientsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#lclients.[info]; client != nil {
342 return client
343 }
344 transfer := c.clientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#client..SSHTransferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#SSHTransfer().(operation, remote)
345 var lclient lockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClient#
346 if transfer != nil {
347 lclient = &sshLockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/sshLockClient#{transferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/sshLockClient#transfer.: transfer, Clientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/sshLockClient#Client.: c.clientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#client.}
348 } else {
349 lclient = &httpLockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/httpLockClient#{Clientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/httpLockClient#Client.: c.clientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#client.}
350 }
351 c.lclientsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#lclients.[info] = lclient
352 return lclient
353 }
354
355 func (c *genericLockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#) Lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#Lock().(remote string, lockReq *lockRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockRequest#) (*lockResponsescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockResponse#, int, error) {
356 return c.getClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#getClient().(remote, "upload").Lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClient#Lock.(remote, lockReq)
357 }
358
359 func (c *genericLockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#) Unlockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#Unlock().(ref *gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#, remote, id string, force bool) (*unlockResponsescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/unlockResponse#, int, error) {
360 return c.getClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#getClient().(remote, "upload").Unlockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClient#Unlock.(ref, remote, id, force)
361 }
362
363 func (c *genericLockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#) Searchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#Search().(remote string, searchReq *lockSearchRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockSearchRequest#) (*lockListscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockList#, int, error) {
364 return c.getClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#getClient().(remote, "download").Searchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClient#Search.(remote, searchReq)
365 }
366
367 func (c *genericLockClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#) SearchVerifiablescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#SearchVerifiable().(remote string, vreq *lockVerifiableRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableRequest#) (*lockVerifiableListscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockVerifiableList#, int, error) {
368 return c.getClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/genericLockClient#getClient().(remote, "upload").SearchVerifiablescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/locking`/lockClient#SearchVerifiable.(remote, vreq)
369 }