File tree Expand file tree Collapse file tree 2 files changed +14
-20
lines changed Expand file tree Collapse file tree 2 files changed +14
-20
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
16
16
17
17
### Fixed
18
18
19
+ - Mode type description in the connection_pool subpackage (#208 )
20
+
19
21
## [ 1.8.0] - 2022-08-17
20
22
21
23
### Added
Original file line number Diff line number Diff line change 1
1
package connection_pool
2
2
3
- type Mode uint32
4
- type Role uint32
5
- type State uint32
6
-
7
3
/*
8
- Mode parameter:
9
-
10
- - ANY (use any instance) - the request can be executed on any instance (master or replica).
11
-
12
- - RW (writeable instance (master)) - the request can only be executed on master.
13
-
14
- - RO (read only instance (replica)) - the request can only be executed on replica.
15
-
16
- - PREFER_RO (prefer read only instance (replica)) - if there is one, otherwise fallback to a writeable one (master).
17
-
18
- - PREFER_RW (prefer write only instance (master)) - if there is one, otherwise fallback to a read only one (replica).
4
+ Default mode for each request table:
19
5
20
6
Request Default mode
21
7
---------- --------------
@@ -30,21 +16,27 @@ Mode parameter:
30
16
| select | ANY |
31
17
| get | ANY |
32
18
*/
19
+ type Mode uint32
20
+
33
21
const (
34
- ANY = iota
35
- RW
36
- RO
37
- PreferRW
38
- PreferRO
22
+ ANY Mode = iota // The request can be executed on any instance (master or replica).
23
+ RW // The request can only be executed on master.
24
+ RO // The request can only be executed on replica.
25
+ PreferRW // If there is one, otherwise fallback to a writeable one (master).
26
+ PreferRO // If there is one, otherwise fallback to a read only one (replica).
39
27
)
40
28
29
+ type Role uint32
30
+
41
31
// master/replica role
42
32
const (
43
33
unknown = iota
44
34
master
45
35
replica
46
36
)
47
37
38
+ type State uint32
39
+
48
40
// pool state
49
41
const (
50
42
connConnected = iota
You can’t perform that action at this time.
0 commit comments