Debian Codegraph @

rpc-client-interface.go

raw symbols SCIP
1 /*
2 * Minio Cloud Storage, (C) 2016 Minio, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package dsync
18
19 // LockArgs is minimal required values for any dsync compatible lock operation.
20 type LockArgs struct {
21 // Unique ID of lock/unlock request.
22 UID string
23
24 // Resource contains a entity to be locked/unlocked.
25 Resource string
26
27 // ServerAddr contains the address of the server who requested lock/unlock of the above resource.
28 ServerAddr string
29
30 // ServiceEndpoint contains the network path of above server to do lock/unlock.
31 ServiceEndpoint string
32 }
33
34 // NetLocker is dsync compatible locker interface.
35 type NetLocker interface {
36 // Do read lock for given LockArgs. It should return
37 // * a boolean to indicate success/failure of the operation
38 // * an error on failure of lock request operation.
39 RLock(args LockArgs) (bool, error)
40
41 // Do write lock for given LockArgs. It should return
42 // * a boolean to indicate success/failure of the operation
43 // * an error on failure of lock request operation.
44 Lock(args LockArgs) (bool, error)
45
46 // Do read unlock for given LockArgs. It should return
47 // * a boolean to indicate success/failure of the operation
48 // * an error on failure of unlock request operation.
49 RUnlock(args LockArgs) (bool, error)
50
51 // Do write unlock for given LockArgs. It should return
52 // * a boolean to indicate success/failure of the operation
53 // * an error on failure of unlock request operation.
54 Unlock(args LockArgs) (bool, error)
55
56 // Unlock (read/write) forcefully for given LockArgs. It should return
57 // * a boolean to indicate success/failure of the operation
58 // * an error on failure of unlock request operation.
59 ForceUnlock(args LockArgs) (bool, error)
60
61 // Return this lock server address.
62 ServerAddr() string
63
64 // Return this lock server service endpoint on which the server runs.
65 ServiceEndpoint() string
66 }