(remote string, searchReq *lockSearchRequest)
| 192 | } |
| 193 | |
| 194 | func (c *sshLockClient) Search(remote string, searchReq *lockSearchRequest) (*lockList, int, error) { |
| 195 | values := searchReq.QueryValues() |
| 196 | args := make([]string, 0, len(values)) |
| 197 | for key, value := range values { |
| 198 | args = append(args, fmt.Sprintf("%s=%s", key, value)) |
| 199 | } |
| 200 | conn, err := c.connection() |
| 201 | if err != nil { |
| 202 | return nil, 0, err |
| 203 | } |
| 204 | conn.Lock() |
| 205 | defer conn.Unlock() |
| 206 | err = conn.SendMessage("list-lock", args) |
| 207 | if err != nil { |
| 208 | return nil, 0, err |
| 209 | } |
| 210 | status, args, lines, err := conn.ReadStatusWithLines() |
| 211 | if err != nil { |
| 212 | return nil, status, err |
| 213 | } |
| 214 | locks, _, _, nextCursor, message, err := c.parseListLockResponse(status, args, lines) |
| 215 | if err != nil { |
| 216 | return nil, status, err |
| 217 | } |
| 218 | list := &lockList{ |
| 219 | Locks: locks, |
| 220 | NextCursor: nextCursor, |
| 221 | Message: message, |
| 222 | } |
| 223 | return list, status, nil |
| 224 | } |
| 225 | |
| 226 | func (c *sshLockClient) SearchVerifiable(remote string, vreq *lockVerifiableRequest) (*lockVerifiableList, int, error) { |
| 227 | args := make([]string, 0, 3) |
nothing calls this directly
no test coverage detected