├── .gitignore ├── LICENSE ├── README.md ├── gorm ├── aggregation_svc │ ├── conf │ │ └── client.yml │ ├── main.go │ └── svc │ │ └── svc.go ├── dialector │ └── mysql │ │ ├── migrator.go │ │ ├── mysql.go │ │ └── update_with_order_by_limit.go ├── go.mod ├── go.sum ├── order_svc │ ├── conf │ │ └── client.yml │ ├── dao │ │ └── dao.go │ └── main.go ├── product_svc │ ├── conf │ │ └── client.yml │ ├── dao │ │ └── dao.go │ └── main.go └── scripts │ ├── seata_order.sql │ └── seata_product.sql ├── http ├── aggregation_svc │ ├── conf │ │ └── config.yml │ ├── main.go │ └── svc │ │ └── svc.go ├── go.mod ├── go.sum ├── order_svc │ ├── conf │ │ └── config.yml │ ├── dao │ │ └── dao.go │ └── main.go ├── product_svc │ ├── conf │ │ └── config.yml │ ├── dao │ │ └── dao.go │ └── main.go └── scripts │ ├── seata_order.sql │ └── seata_product.sql ├── tcc-remote ├── conf │ ├── config1.yml │ └── config2.yml ├── go.mod ├── go.sum ├── main.go ├── main2.go └── service │ ├── service.go │ ├── service_a.go │ └── service_b.go └── tcc ├── conf └── config.yml ├── go.mod ├── go.sum ├── main.go └── service ├── service.go ├── service_a.go ├── service_b.go └── service_c.go /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | .idea/ 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # seata-go-samples 2 | 3 | ## Step0: setup TC server 4 | ```bash 5 | git clone git@github.com:opentrx/seata-golang.git 6 | cd seata-golang 7 | 8 | vim ./cmd/profiles/dev/config.yml 9 | # update storage.mysql.dsn 10 | # update log.logPath 11 | 12 | # create database `seata` on mysql server 13 | # mysql> CREATE database if NOT EXISTS `seata` default character set utf8mb4 collate utf8mb4_unicode_ci; 14 | 15 | cd cmd/tc 16 | go run main.go start -config ../profiles/dev/config.yml 17 | ``` 18 | 19 | - ## AT mode example (gorm or http) 20 | ### Step1: setup aggregation_svc client 21 | ```bash 22 | cd seata-go-samples/gorm 23 | vim ./aggregation_svc/conf/client.yml 24 | # update log.logPath 25 | 26 | export ConfigPath="./aggregation_svc/conf/client.yml" 27 | go run aggregation_svc/main.go 28 | ``` 29 | 30 | ### Step2: setup order_svc client 31 | ```bash 32 | cd seata-go-samples/gorm 33 | vim ./order_svc/conf/client.yml 34 | # update at.dsn 35 | # update log.logPath 36 | 37 | export ConfigPath="./order_svc/conf/client.yml" 38 | go run order_svc/main.go 39 | ``` 40 | 41 | ### Step3: setup product_svc client 42 | ```bash 43 | cd seata-go-samples/gorm 44 | vim ./product_svc/conf/client.yml 45 | # update at.dsn 46 | # update log.logPath 47 | 48 | export ConfigPath="./product_svc/conf/client.yml" 49 | go run product_svc/main.go 50 | ``` 51 | 52 | ### Step4: access 53 | - http://localhost:8003/createSoCommit 54 | - http://localhost:8003/createSoRollback 55 | 56 | - ## TCC mode example (tcc) 57 | ### Step1: setup client 58 | ```bash 59 | cd seata-go-samples/tcc 60 | 61 | export ConfigPath="./conf/config.yml" 62 | go run main.go 63 | ``` 64 | 65 | ### step2: access 66 | - http://localhost:8080/commit 67 | - http://localhost:8080/rollback -------------------------------------------------------------------------------- /gorm/aggregation_svc/conf/client.yml: -------------------------------------------------------------------------------- 1 | addressing: aggregationSvc 2 | serverAddressing: localhost:8091 3 | tm: 4 | commitRetryCount: 5 5 | rollbackRetryCount: 5 6 | enforcementPolicy: 7 | minTime: 5m 8 | permitWithoutStream: true 9 | serverParameters: 10 | maxConnectionIdle: 15s 11 | maxConnectionAge: 30s 12 | maxConnectionAgeGrace: 5s 13 | time: 5s 14 | timeout: 20s 15 | clientTLS: 16 | enable: false 17 | certFilePath: "" 18 | serverName: "test.seata.io" 19 | log: 20 | logPath: /Users/scottlewis/dksl/temp/seata-samples/gorm/aggregation_svc/aggregation.log 21 | logLevel: info -------------------------------------------------------------------------------- /gorm/aggregation_svc/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/gin-gonic/gin" 7 | "github.com/opentrx/seata-golang/v2/pkg/client" 8 | "github.com/opentrx/seata-golang/v2/pkg/client/config" 9 | "github.com/opentrx/seata-golang/v2/pkg/client/tm" 10 | "github.com/opentrx/seata-golang/v2/pkg/util/log" 11 | 12 | "net/http" 13 | _ "net/http/pprof" 14 | 15 | "github.com/opentrx/seata-go-samples/aggregation_svc/svc" 16 | ) 17 | 18 | func init() { 19 | go func() { 20 | http.ListenAndServe("0.0.0.0:6060", nil) 21 | }() 22 | } 23 | 24 | func main() { 25 | r := gin.Default() 26 | 27 | configPath := os.Getenv("ConfigPath") 28 | conf := config.InitConfiguration(configPath) 29 | 30 | log.Init(conf.Log.LogPath, conf.Log.LogLevel) 31 | client.Init(conf) 32 | 33 | tm.Implement(svc.ProxySvc) 34 | 35 | r.GET("/createSoCommit", func(c *gin.Context) { 36 | 37 | if err := svc.ProxySvc.CreateSo(c, false); err == nil { 38 | c.JSON(200, gin.H{ 39 | "success": true, 40 | "message": "success", 41 | }) 42 | } else { 43 | c.JSON(500, gin.H{ 44 | "success": false, 45 | "message": err.Error(), 46 | }) 47 | } 48 | 49 | }) 50 | 51 | r.GET("/createSoRollback", func(c *gin.Context) { 52 | 53 | if err := svc.ProxySvc.CreateSo(c, true); err == nil { 54 | c.JSON(200, gin.H{ 55 | "success": true, 56 | "message": "success", 57 | }) 58 | } else { 59 | c.JSON(500, gin.H{ 60 | "success": false, 61 | "message": err.Error(), 62 | }) 63 | } 64 | }) 65 | 66 | r.Run(":8003") 67 | } 68 | -------------------------------------------------------------------------------- /gorm/aggregation_svc/svc/svc.go: -------------------------------------------------------------------------------- 1 | package svc 2 | 3 | import ( 4 | "bytes" 5 | "context" 6 | "encoding/json" 7 | "errors" 8 | "fmt" 9 | "net/http" 10 | 11 | dao2 "github.com/opentrx/seata-go-samples/product_svc/dao" 12 | context2 "github.com/opentrx/seata-golang/v2/pkg/client/base/context" 13 | "github.com/opentrx/seata-golang/v2/pkg/client/base/model" 14 | 15 | "github.com/opentrx/seata-go-samples/order_svc/dao" 16 | ) 17 | 18 | type Svc struct { 19 | } 20 | 21 | func (svc *Svc) CreateSo(ctx context.Context, rollback bool) error { 22 | rootContext := ctx.(*context2.RootContext) 23 | soMasters := []*dao.SoMaster{ 24 | { 25 | BuyerUserSysno: 10001, 26 | SellerCompanyCode: "SC001", 27 | ReceiveDivisionSysno: 110105, 28 | ReceiveAddress: "朝阳区长安街001号", 29 | ReceiveZip: "000001", 30 | ReceiveContact: "斯密达", 31 | ReceiveContactPhone: "18728828296", 32 | StockSysno: 1, 33 | PaymentType: 1, 34 | SoAmt: 430.5, 35 | Status: 10, 36 | Appid: "dk-order", 37 | SoItems: []*dao.SoItem{ 38 | { 39 | ProductSysno: 1, 40 | ProductName: "刺力王", 41 | CostPrice: 200, 42 | OriginalPrice: 232, 43 | DealPrice: 215.25, 44 | Quantity: 2, 45 | }, 46 | }, 47 | }, 48 | } 49 | 50 | reqs := []*dao2.AllocateInventoryReq{{ 51 | ProductSysNo: 1, 52 | Qty: 2, 53 | }} 54 | 55 | type rq1 struct { 56 | Req []*dao.SoMaster 57 | } 58 | 59 | type rq2 struct { 60 | Req []*dao2.AllocateInventoryReq 61 | } 62 | 63 | q1 := &rq1{Req: soMasters} 64 | soReq, err := json.Marshal(q1) 65 | fmt.Println(string(soReq)) 66 | req1, err := http.NewRequest("POST", "http://localhost:8002/createSo", bytes.NewBuffer(soReq)) 67 | if err != nil { 68 | panic(err) 69 | } 70 | req1.Header.Set("Content-Type", "application/json") 71 | req1.Header.Set("xid", rootContext.GetXID()) 72 | 73 | client := &http.Client{} 74 | result1, err1 := client.Do(req1) 75 | if err1 != nil { 76 | return err1 77 | } 78 | 79 | if result1.StatusCode == 400 { 80 | return errors.New("err") 81 | } 82 | 83 | q2 := &rq2{ 84 | Req: reqs, 85 | } 86 | ivtReq, _ := json.Marshal(q2) 87 | fmt.Println(string(ivtReq)) 88 | req2, err := http.NewRequest("POST", "http://localhost:8001/allocateInventory", bytes.NewBuffer(ivtReq)) 89 | if err != nil { 90 | panic(err) 91 | } 92 | req2.Header.Set("Content-Type", "application/json") 93 | req2.Header.Set("xid", rootContext.GetXID()) 94 | 95 | result2, err2 := client.Do(req2) 96 | if err2 != nil { 97 | return err2 98 | } 99 | 100 | if result2.StatusCode == 400 { 101 | return errors.New("err") 102 | } 103 | 104 | if rollback { 105 | return errors.New("there is a error") 106 | } 107 | return nil 108 | } 109 | 110 | var service = &Svc{} 111 | 112 | type ProxyService struct { 113 | *Svc 114 | CreateSo func(ctx context.Context, rollback bool) error 115 | } 116 | 117 | var methodTransactionInfo = make(map[string]*model.TransactionInfo) 118 | 119 | func init() { 120 | methodTransactionInfo["CreateSo"] = &model.TransactionInfo{ 121 | TimeOut: 60000000, 122 | Name: "CreateSo", 123 | Propagation: model.Required, 124 | } 125 | } 126 | 127 | func (svc *ProxyService) GetProxyService() interface{} { 128 | return svc.Svc 129 | } 130 | 131 | func (svc *ProxyService) GetMethodTransactionInfo(methodName string) *model.TransactionInfo { 132 | return methodTransactionInfo[methodName] 133 | } 134 | 135 | var ProxySvc = &ProxyService{ 136 | Svc: service, 137 | } 138 | -------------------------------------------------------------------------------- /gorm/dialector/mysql/migrator.go: -------------------------------------------------------------------------------- 1 | package mysql 2 | 3 | import ( 4 | "database/sql" 5 | "fmt" 6 | 7 | "gorm.io/gorm" 8 | "gorm.io/gorm/clause" 9 | "gorm.io/gorm/migrator" 10 | "gorm.io/gorm/schema" 11 | ) 12 | 13 | type Migrator struct { 14 | migrator.Migrator 15 | Dialector 16 | } 17 | 18 | type Column struct { 19 | name string 20 | nullable sql.NullString 21 | datatype string 22 | maxlen sql.NullInt64 23 | precision sql.NullInt64 24 | scale sql.NullInt64 25 | datetimeprecision sql.NullInt64 26 | } 27 | 28 | func (c Column) Name() string { 29 | return c.name 30 | } 31 | 32 | func (c Column) DatabaseTypeName() string { 33 | return c.datatype 34 | } 35 | 36 | func (c Column) Length() (length int64, ok bool) { 37 | ok = c.maxlen.Valid 38 | if ok { 39 | length = c.maxlen.Int64 40 | } else { 41 | length = 0 42 | } 43 | return 44 | } 45 | 46 | func (c Column) Nullable() (nullable bool, ok bool) { 47 | if c.nullable.Valid { 48 | nullable, ok = c.nullable.String == "YES", true 49 | } else { 50 | nullable, ok = false, false 51 | } 52 | return 53 | } 54 | 55 | func (c Column) DecimalSize() (precision int64, scale int64, ok bool) { 56 | if c.precision.Valid { 57 | if c.scale.Valid { 58 | precision, scale, ok = c.precision.Int64, c.scale.Int64, true 59 | } else { 60 | precision, scale, ok = c.precision.Int64, 0, true 61 | } 62 | } else if c.datetimeprecision.Valid { 63 | precision, scale, ok = c.datetimeprecision.Int64, 0, true 64 | } else { 65 | precision, scale, ok = 0, 0, false 66 | } 67 | return 68 | } 69 | 70 | func (m Migrator) FullDataTypeOf(field *schema.Field) clause.Expr { 71 | expr := m.Migrator.FullDataTypeOf(field) 72 | 73 | if value, ok := field.TagSettings["COMMENT"]; ok { 74 | expr.SQL += " COMMENT " + m.Dialector.Explain("?", value) 75 | } 76 | 77 | return expr 78 | } 79 | 80 | func (m Migrator) AlterColumn(value interface{}, field string) error { 81 | return m.RunWithValue(value, func(stmt *gorm.Statement) error { 82 | if field := stmt.Schema.LookUpField(field); field != nil { 83 | return m.DB.Exec( 84 | "ALTER TABLE ? MODIFY COLUMN ? ?", 85 | clause.Table{Name: stmt.Table}, clause.Column{Name: field.DBName}, m.FullDataTypeOf(field), 86 | ).Error 87 | } 88 | return fmt.Errorf("failed to look up field with name: %s", field) 89 | }) 90 | } 91 | 92 | func (m Migrator) RenameColumn(value interface{}, oldName, newName string) error { 93 | return m.RunWithValue(value, func(stmt *gorm.Statement) error { 94 | if m.Dialector.DontSupportRenameColumn { 95 | var field *schema.Field 96 | if f := stmt.Schema.LookUpField(oldName); f != nil { 97 | oldName = f.DBName 98 | field = f 99 | } 100 | 101 | if f := stmt.Schema.LookUpField(newName); f != nil { 102 | newName = f.DBName 103 | field = f 104 | } 105 | 106 | if field != nil { 107 | return m.DB.Exec( 108 | "ALTER TABLE ? CHANGE ? ? ?", 109 | clause.Table{Name: stmt.Table}, clause.Column{Name: oldName}, clause.Column{Name: newName}, m.FullDataTypeOf(field), 110 | ).Error 111 | } 112 | } else { 113 | return m.Migrator.RenameColumn(value, oldName, newName) 114 | } 115 | 116 | return fmt.Errorf("failed to look up field with name: %s", newName) 117 | }) 118 | } 119 | 120 | func (m Migrator) RenameIndex(value interface{}, oldName, newName string) error { 121 | if m.Dialector.DontSupportRenameIndex { 122 | return m.RunWithValue(value, func(stmt *gorm.Statement) error { 123 | err := m.DropIndex(value, oldName) 124 | if err == nil { 125 | if idx := stmt.Schema.LookIndex(newName); idx == nil { 126 | if idx = stmt.Schema.LookIndex(oldName); idx != nil { 127 | opts := m.BuildIndexOptions(idx.Fields, stmt) 128 | values := []interface{}{clause.Column{Name: newName}, clause.Table{Name: stmt.Table}, opts} 129 | 130 | createIndexSQL := "CREATE " 131 | if idx.Class != "" { 132 | createIndexSQL += idx.Class + " " 133 | } 134 | createIndexSQL += "INDEX ? ON ??" 135 | 136 | if idx.Type != "" { 137 | createIndexSQL += " USING " + idx.Type 138 | } 139 | 140 | return m.DB.Exec(createIndexSQL, values...).Error 141 | } 142 | } 143 | 144 | err = m.CreateIndex(value, newName) 145 | } 146 | 147 | return err 148 | }) 149 | } else { 150 | return m.RunWithValue(value, func(stmt *gorm.Statement) error { 151 | return m.DB.Exec( 152 | "ALTER TABLE ? RENAME INDEX ? TO ?", 153 | clause.Table{Name: stmt.Table}, clause.Column{Name: oldName}, clause.Column{Name: newName}, 154 | ).Error 155 | }) 156 | } 157 | } 158 | 159 | func (m Migrator) DropTable(values ...interface{}) error { 160 | values = m.ReorderModels(values, false) 161 | tx := m.DB.Session(&gorm.Session{}) 162 | tx.Exec("SET FOREIGN_KEY_CHECKS = 0;") 163 | for i := len(values) - 1; i >= 0; i-- { 164 | if err := m.RunWithValue(values[i], func(stmt *gorm.Statement) error { 165 | return tx.Exec("DROP TABLE IF EXISTS ? CASCADE", clause.Table{Name: stmt.Table}).Error 166 | }); err != nil { 167 | return err 168 | } 169 | } 170 | tx.Exec("SET FOREIGN_KEY_CHECKS = 1;") 171 | return nil 172 | } 173 | 174 | func (m Migrator) DropConstraint(value interface{}, name string) error { 175 | return m.RunWithValue(value, func(stmt *gorm.Statement) error { 176 | constraint, chk, table := m.GuessConstraintAndTable(stmt, name) 177 | if chk != nil { 178 | return m.DB.Exec("ALTER TABLE ? DROP CHECK ?", clause.Table{Name: stmt.Table}, clause.Column{Name: chk.Name}).Error 179 | } 180 | if constraint != nil { 181 | name = constraint.Name 182 | } 183 | 184 | return m.DB.Exec( 185 | "ALTER TABLE ? DROP FOREIGN KEY ?", clause.Table{Name: table}, clause.Column{Name: name}, 186 | ).Error 187 | }) 188 | } 189 | 190 | func (m Migrator) ColumnTypes(value interface{}) (columnTypes []gorm.ColumnType, err error) { 191 | columnTypes = make([]gorm.ColumnType, 0) 192 | err = m.RunWithValue(value, func(stmt *gorm.Statement) error { 193 | var ( 194 | currentDatabase = m.DB.Migrator().CurrentDatabase() 195 | columnTypeSQL = "SELECT column_name, is_nullable, data_type, character_maximum_length, numeric_precision, numeric_scale " 196 | ) 197 | 198 | if !m.DisableDatetimePrecision { 199 | columnTypeSQL += ", datetime_precision " 200 | } 201 | columnTypeSQL += "FROM information_schema.columns WHERE table_schema = ? AND table_name = ?" 202 | 203 | columns, err := m.DB.Raw(columnTypeSQL, currentDatabase, stmt.Table).Rows() 204 | if err != nil { 205 | return err 206 | } 207 | defer columns.Close() 208 | 209 | for columns.Next() { 210 | var column Column 211 | var values = []interface{}{&column.name, &column.nullable, &column.datatype, &column.maxlen, &column.precision, &column.scale} 212 | 213 | if !m.DisableDatetimePrecision { 214 | values = append(values, &column.datetimeprecision) 215 | } 216 | 217 | if err = columns.Scan(values...); err != nil { 218 | return err 219 | } 220 | columnTypes = append(columnTypes, column) 221 | } 222 | 223 | return err 224 | }) 225 | return 226 | } 227 | -------------------------------------------------------------------------------- /gorm/dialector/mysql/mysql.go: -------------------------------------------------------------------------------- 1 | package mysql 2 | 3 | import ( 4 | "context" 5 | "database/sql" 6 | "fmt" 7 | "math" 8 | "strings" 9 | "time" 10 | 11 | _ "github.com/opentrx/mysql/v2" 12 | "gorm.io/gorm" 13 | "gorm.io/gorm/callbacks" 14 | "gorm.io/gorm/clause" 15 | "gorm.io/gorm/logger" 16 | "gorm.io/gorm/migrator" 17 | "gorm.io/gorm/schema" 18 | ) 19 | 20 | type Config struct { 21 | DriverName string 22 | DSN string 23 | Conn gorm.ConnPool 24 | SkipInitializeWithVersion bool 25 | DefaultStringSize uint 26 | DefaultDatetimePrecision *int 27 | DisableDatetimePrecision bool 28 | DontSupportRenameIndex bool 29 | DontSupportRenameColumn bool 30 | DontSupportForShareClause bool 31 | } 32 | 33 | type Dialector struct { 34 | *Config 35 | } 36 | 37 | func Open(dsn string) gorm.Dialector { 38 | return &Dialector{Config: &Config{DSN: dsn}} 39 | } 40 | 41 | func New(config Config) gorm.Dialector { 42 | return &Dialector{Config: &config} 43 | } 44 | 45 | func (dialector Dialector) Name() string { 46 | return "mysql" 47 | } 48 | 49 | func (dialector Dialector) Apply(config *gorm.Config) error { 50 | if config.NowFunc == nil { 51 | if dialector.DefaultDatetimePrecision == nil { 52 | var defaultDatetimePrecision = 3 53 | dialector.DefaultDatetimePrecision = &defaultDatetimePrecision 54 | } 55 | 56 | round := time.Second / time.Duration(math.Pow10(*dialector.DefaultDatetimePrecision)) 57 | config.NowFunc = func() time.Time { return time.Now().Local().Round(round) } 58 | } 59 | return nil 60 | } 61 | 62 | func (dialector Dialector) Initialize(db *gorm.DB) (err error) { 63 | ctx := context.Background() 64 | 65 | // register callbacks 66 | callbacks.RegisterDefaultCallbacks(db, &callbacks.Config{}) 67 | 68 | db.Callback().Update().Replace("gorm:update", Update) 69 | 70 | if dialector.DriverName == "" { 71 | dialector.DriverName = "mysql" 72 | } 73 | 74 | if dialector.DefaultDatetimePrecision == nil { 75 | var defaultDatetimePrecision = 3 76 | dialector.DefaultDatetimePrecision = &defaultDatetimePrecision 77 | } 78 | 79 | if dialector.Conn != nil { 80 | db.ConnPool = dialector.Conn 81 | } else { 82 | db.ConnPool, err = sql.Open(dialector.DriverName, dialector.DSN) 83 | if err != nil { 84 | return err 85 | } 86 | } 87 | 88 | if !dialector.Config.SkipInitializeWithVersion { 89 | var version string 90 | err = db.ConnPool.QueryRowContext(ctx, "SELECT VERSION()").Scan(&version) 91 | if err != nil { 92 | return err 93 | } 94 | 95 | if strings.Contains(version, "MariaDB") { 96 | dialector.Config.DontSupportRenameIndex = true 97 | dialector.Config.DontSupportRenameColumn = true 98 | dialector.Config.DontSupportForShareClause = true 99 | } else if strings.HasPrefix(version, "5.6.") { 100 | dialector.Config.DontSupportRenameIndex = true 101 | dialector.Config.DontSupportRenameColumn = true 102 | dialector.Config.DontSupportForShareClause = true 103 | } else if strings.HasPrefix(version, "5.7.") { 104 | dialector.Config.DontSupportRenameColumn = true 105 | dialector.Config.DontSupportForShareClause = true 106 | } else if strings.HasPrefix(version, "5.") { 107 | dialector.Config.DisableDatetimePrecision = true 108 | dialector.Config.DontSupportRenameIndex = true 109 | dialector.Config.DontSupportRenameColumn = true 110 | dialector.Config.DontSupportForShareClause = true 111 | } 112 | } 113 | 114 | for k, v := range dialector.ClauseBuilders() { 115 | db.ClauseBuilders[k] = v 116 | } 117 | return 118 | } 119 | 120 | func (dialector Dialector) ClauseBuilders() map[string]clause.ClauseBuilder { 121 | clauseBuilders := map[string]clause.ClauseBuilder{ 122 | "ON CONFLICT": func(c clause.Clause, builder clause.Builder) { 123 | if onConflict, ok := c.Expression.(clause.OnConflict); ok { 124 | builder.WriteString("ON DUPLICATE KEY UPDATE ") 125 | if len(onConflict.DoUpdates) == 0 { 126 | if s := builder.(*gorm.Statement).Schema; s != nil { 127 | var column clause.Column 128 | onConflict.DoNothing = false 129 | 130 | if s.PrioritizedPrimaryField != nil { 131 | column = clause.Column{Name: s.PrioritizedPrimaryField.DBName} 132 | } else if len(s.DBNames) > 0 { 133 | column = clause.Column{Name: s.DBNames[0]} 134 | } 135 | 136 | if column.Name != "" { 137 | onConflict.DoUpdates = []clause.Assignment{{Column: column, Value: column}} 138 | } 139 | } 140 | } 141 | 142 | for idx, assignment := range onConflict.DoUpdates { 143 | if idx > 0 { 144 | builder.WriteByte(',') 145 | } 146 | 147 | builder.WriteQuoted(assignment.Column) 148 | builder.WriteByte('=') 149 | if column, ok := assignment.Value.(clause.Column); ok && column.Table == "excluded" { 150 | column.Table = "" 151 | builder.WriteString("VALUES(") 152 | builder.WriteQuoted(column) 153 | builder.WriteByte(')') 154 | } else { 155 | builder.AddVar(builder, assignment.Value) 156 | } 157 | } 158 | } else { 159 | c.Build(builder) 160 | } 161 | }, 162 | "VALUES": func(c clause.Clause, builder clause.Builder) { 163 | if values, ok := c.Expression.(clause.Values); ok && len(values.Columns) == 0 { 164 | builder.WriteString("VALUES()") 165 | return 166 | } 167 | c.Build(builder) 168 | }, 169 | } 170 | 171 | if dialector.Config.DontSupportForShareClause { 172 | clauseBuilders["FOR"] = func(c clause.Clause, builder clause.Builder) { 173 | if values, ok := c.Expression.(clause.Locking); ok && strings.EqualFold(values.Strength, "SHARE") { 174 | builder.WriteString("LOCK IN SHARE MODE") 175 | return 176 | } 177 | c.Build(builder) 178 | } 179 | } 180 | 181 | return clauseBuilders 182 | } 183 | 184 | func (dialector Dialector) DefaultValueOf(field *schema.Field) clause.Expression { 185 | return clause.Expr{SQL: "DEFAULT"} 186 | } 187 | 188 | func (dialector Dialector) Migrator(db *gorm.DB) gorm.Migrator { 189 | return Migrator{ 190 | Migrator: migrator.Migrator{ 191 | Config: migrator.Config{ 192 | DB: db, 193 | Dialector: dialector, 194 | }, 195 | }, 196 | Dialector: dialector, 197 | } 198 | } 199 | 200 | func (dialector Dialector) BindVarTo(writer clause.Writer, stmt *gorm.Statement, v interface{}) { 201 | writer.WriteByte('?') 202 | } 203 | 204 | func (dialector Dialector) QuoteTo(writer clause.Writer, str string) { 205 | writer.WriteByte('`') 206 | if strings.Contains(str, ".") { 207 | for idx, str := range strings.Split(str, ".") { 208 | if idx > 0 { 209 | writer.WriteString(".`") 210 | } 211 | writer.WriteString(str) 212 | writer.WriteByte('`') 213 | } 214 | } else { 215 | writer.WriteString(str) 216 | writer.WriteByte('`') 217 | } 218 | } 219 | 220 | func (dialector Dialector) Explain(sql string, vars ...interface{}) string { 221 | return logger.ExplainSQL(sql, nil, `'`, vars...) 222 | } 223 | 224 | func (dialector Dialector) DataTypeOf(field *schema.Field) string { 225 | switch field.DataType { 226 | case schema.Bool: 227 | return "boolean" 228 | case schema.Int, schema.Uint: 229 | sqlType := "bigint" 230 | switch { 231 | case field.Size <= 8: 232 | sqlType = "tinyint" 233 | case field.Size <= 16: 234 | sqlType = "smallint" 235 | case field.Size <= 24: 236 | sqlType = "mediumint" 237 | case field.Size <= 32: 238 | sqlType = "int" 239 | } 240 | 241 | if field.DataType == schema.Uint { 242 | sqlType += " unsigned" 243 | } 244 | 245 | if field.AutoIncrement { 246 | sqlType += " AUTO_INCREMENT" 247 | } 248 | return sqlType 249 | case schema.Float: 250 | if field.Precision > 0 { 251 | return fmt.Sprintf("decimal(%d, %d)", field.Precision, field.Scale) 252 | } 253 | 254 | if field.Size <= 32 { 255 | return "float" 256 | } 257 | return "double" 258 | case schema.String: 259 | size := field.Size 260 | defaultSize := dialector.DefaultStringSize 261 | 262 | if size == 0 { 263 | if defaultSize > 0 { 264 | size = int(defaultSize) 265 | } else { 266 | hasIndex := field.TagSettings["INDEX"] != "" || field.TagSettings["UNIQUE"] != "" 267 | // TEXT, GEOMETRY or JSON column can't have a default value 268 | if field.PrimaryKey || field.HasDefaultValue || hasIndex { 269 | size = 191 // utf8mb4 270 | } 271 | } 272 | } 273 | 274 | if size >= 65536 && size <= int(math.Pow(2, 24)) { 275 | return "mediumtext" 276 | } else if size > int(math.Pow(2, 24)) || size <= 0 { 277 | return "longtext" 278 | } 279 | return fmt.Sprintf("varchar(%d)", size) 280 | case schema.Time: 281 | precision := "" 282 | 283 | if !dialector.DisableDatetimePrecision && field.Precision == 0 { 284 | field.Precision = *dialector.DefaultDatetimePrecision 285 | } 286 | 287 | if field.Precision > 0 { 288 | precision = fmt.Sprintf("(%d)", field.Precision) 289 | } 290 | 291 | if field.NotNull || field.PrimaryKey { 292 | return "datetime" + precision 293 | } 294 | return "datetime" + precision + " NULL" 295 | case schema.Bytes: 296 | if field.Size > 0 && field.Size < 65536 { 297 | return fmt.Sprintf("varbinary(%d)", field.Size) 298 | } 299 | 300 | if field.Size >= 65536 && field.Size <= int(math.Pow(2, 24)) { 301 | return "mediumblob" 302 | } 303 | 304 | return "longblob" 305 | } 306 | 307 | return string(field.DataType) 308 | } 309 | 310 | func (dialectopr Dialector) SavePoint(tx *gorm.DB, name string) error { 311 | tx.Exec("SAVEPOINT " + name) 312 | return nil 313 | } 314 | 315 | func (dialectopr Dialector) RollbackTo(tx *gorm.DB, name string) error { 316 | tx.Exec("ROLLBACK TO SAVEPOINT " + name) 317 | return nil 318 | } 319 | -------------------------------------------------------------------------------- /gorm/dialector/mysql/update_with_order_by_limit.go: -------------------------------------------------------------------------------- 1 | package mysql 2 | 3 | import ( 4 | "gorm.io/gorm" 5 | "gorm.io/gorm/callbacks" 6 | "gorm.io/gorm/clause" 7 | ) 8 | 9 | func Update(db *gorm.DB) { 10 | if db.Error == nil { 11 | if db.Statement.Schema != nil && !db.Statement.Unscoped { 12 | for _, c := range db.Statement.Schema.UpdateClauses { 13 | db.Statement.AddClause(c) 14 | } 15 | } 16 | 17 | if db.Statement.SQL.String() == "" { 18 | db.Statement.SQL.Grow(180) 19 | db.Statement.AddClauseIfNotExists(clause.Update{}) 20 | if set := callbacks.ConvertToAssignments(db.Statement); len(set) != 0 { 21 | db.Statement.AddClause(set) 22 | } else { 23 | return 24 | } 25 | db.Statement.Build("UPDATE", "SET", "WHERE", "ORDER BY", "LIMIT") 26 | } 27 | 28 | if _, ok := db.Statement.Clauses["WHERE"]; !db.AllowGlobalUpdate && !ok { 29 | db.AddError(gorm.ErrMissingWhereClause) 30 | return 31 | } 32 | 33 | if !db.DryRun && db.Error == nil { 34 | result, err := db.Statement.ConnPool.ExecContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...) 35 | 36 | if err == nil { 37 | db.RowsAffected, _ = result.RowsAffected() 38 | } else { 39 | db.AddError(err) 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /gorm/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/opentrx/seata-go-samples 2 | 3 | go 1.15 4 | 5 | require ( 6 | github.com/gin-gonic/gin v1.6.3 7 | github.com/gogf/gf v1.15.6 8 | github.com/google/uuid v1.2.0 9 | github.com/opentrx/mysql/v2 v2.0.6 10 | github.com/opentrx/seata-golang/v2 v2.0.7-rc3 11 | github.com/pingcap/check v0.0.0-20200212061837-5e12011dc712 // indirect 12 | github.com/pingcap/errors v0.11.5-0.20190809092503-95897b64e011 // indirect 13 | github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd // indirect 14 | gorm.io/gorm v1.21.8 15 | ) 16 | -------------------------------------------------------------------------------- /gorm/order_svc/conf/client.yml: -------------------------------------------------------------------------------- 1 | addressing: orderSvc 2 | serverAddressing: localhost:8091 3 | tm: 4 | commitRetryCount: 5 5 | rollbackRetryCount: 5 6 | at: 7 | dsn: "root:123456@tcp(127.0.0.1:3306)/seata_order?timeout=5s&readTimeout=5s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8" 8 | reportRetryCount: 5 9 | reportSuccessEnable: false 10 | lockRetryInterval: 20ms 11 | lockRetryTimes: 30 12 | clientParameters: 13 | time: 10s 14 | timeout: 20s 15 | permitWithoutStream: true 16 | clientTLS: 17 | enable: false 18 | certFilePath: "" 19 | serverName: "test.seata.io" 20 | log: 21 | logPath: /Users/scottlewis/dksl/temp/seata-samples/gorm/order_svc/order.log 22 | logLevel: info -------------------------------------------------------------------------------- /gorm/order_svc/dao/dao.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "context" 5 | "database/sql" 6 | "time" 7 | 8 | "github.com/gogf/gf/util/gconv" 9 | "github.com/google/uuid" 10 | "gorm.io/gorm" 11 | "gorm.io/gorm/clause" 12 | ) 13 | 14 | type Dao struct { 15 | DB *gorm.DB 16 | } 17 | 18 | //现实中涉及金额可能使用长整形,这里使用 float64 仅作测试,不具有参考意义 19 | 20 | type SoMaster struct { 21 | Sysno int64 `json:"sysNo"` 22 | SoId string `json:"soID"` 23 | BuyerUserSysno int64 `json:"buyerUserSysNo"` 24 | SellerCompanyCode string `json:"sellerCompanyCode"` 25 | ReceiveDivisionSysno int64 `json:"receiveDivisionSysNo"` 26 | ReceiveAddress string `json:"receiveAddress"` 27 | ReceiveZip string `json:"receiveZip"` 28 | ReceiveContact string `json:"receiveContact"` 29 | ReceiveContactPhone string `json:"receiveContactPhone"` 30 | StockSysno int64 `json:"stockSysNo"` 31 | PaymentType int32 `json:"paymentType"` 32 | SoAmt float64 `json:"soAmt"` 33 | //10,创建成功,待支付;30;支付成功,待发货;50;发货成功,待收货;70,确认收货,已完成;90,下单失败;100已作废 34 | Status int32 `json:"status"` 35 | OrderDate time.Time `json:"orderDate"` 36 | PaymentDate *time.Time `json:"paymentDate"` 37 | DeliveryDate *time.Time `json:"deliveryDate"` 38 | ReceiveDate *time.Time `json:"receiveDate"` 39 | Appid string `json:"appID"` 40 | Memo string `json:"memo"` 41 | CreateUser *string `json:"createUser"` 42 | GmtCreate *time.Time `json:"gmtCreate"` 43 | ModifyUser *string `json:"modifyUser"` 44 | GmtModified *time.Time `json:"gmtModified"` 45 | 46 | SoItems []*SoItem `gorm:"-"` 47 | } 48 | 49 | type SoItem struct { 50 | Sysno int64 `json:"sysNo"` 51 | SoSysno int64 `json:"soSysNo"` 52 | ProductSysno int64 `json:"productSysNo"` 53 | ProductName string `json:"productName"` 54 | CostPrice float64 `json:"costPrice"` 55 | OriginalPrice float64 `json:"originalPrice"` 56 | DealPrice float64 `json:"dealPrice"` 57 | Quantity int32 `json:"quantity"` 58 | } 59 | 60 | func (dao *Dao) CreateSO(ctx context.Context, soMasters []*SoMaster) ([]uint64, error) { 61 | result := make([]uint64, 0, len(soMasters)) 62 | tx := dao.DB.WithContext(ctx).Begin(&sql.TxOptions{ 63 | Isolation: sql.LevelDefault, 64 | ReadOnly: false, 65 | }) 66 | 67 | for _, soMaster := range soMasters { 68 | soid := NextID() 69 | so_master := &SoMaster{ 70 | Sysno: gconv.Int64(soid), 71 | SoId: gconv.String(soid), 72 | BuyerUserSysno: soMaster.BuyerUserSysno, 73 | SellerCompanyCode: soMaster.SellerCompanyCode, 74 | ReceiveDivisionSysno: soMaster.ReceiveDivisionSysno, 75 | ReceiveAddress: soMaster.ReceiveAddress, 76 | ReceiveZip: soMaster.ReceiveZip, 77 | ReceiveContact: soMaster.ReceiveContact, 78 | ReceiveContactPhone: soMaster.ReceiveContactPhone, 79 | StockSysno: soMaster.StockSysno, 80 | PaymentType: soMaster.PaymentType, 81 | SoAmt: soMaster.SoAmt, 82 | Status: soMaster.Status, 83 | OrderDate: time.Now(), 84 | Appid: soMaster.Appid, 85 | Memo: soMaster.Memo, 86 | } 87 | 88 | if err := tx.Omit(clause.Associations).Create(so_master).Error; err != nil { 89 | tx.Rollback() 90 | return nil, err 91 | } 92 | 93 | soItems := soMaster.SoItems 94 | for _, soItem := range soItems { 95 | soItemID := NextID() 96 | so_item := &SoItem{ 97 | Sysno: gconv.Int64(soItemID), 98 | SoSysno: gconv.Int64(soid), 99 | ProductSysno: soItem.ProductSysno, 100 | ProductName: soItem.ProductName, 101 | CostPrice: soItem.CostPrice, 102 | OriginalPrice: soItem.OriginalPrice, 103 | DealPrice: soItem.DealPrice, 104 | Quantity: soItem.Quantity, 105 | } 106 | if err := tx.Create(so_item).Error; err != nil { 107 | tx.Rollback() 108 | return nil, err 109 | } 110 | } 111 | result = append(result, soid) 112 | } 113 | err := tx.Commit().Error 114 | if err != nil { 115 | return nil, err 116 | } 117 | return result, nil 118 | } 119 | 120 | func NextID() uint64 { 121 | id, _ := uuid.NewUUID() 122 | return uint64(id.ID()) 123 | } 124 | -------------------------------------------------------------------------------- /gorm/order_svc/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "gorm.io/gorm" 6 | "gorm.io/gorm/logger" 7 | "gorm.io/gorm/schema" 8 | "net/http" 9 | "os" 10 | "time" 11 | 12 | "github.com/gin-gonic/gin" 13 | "github.com/opentrx/mysql/v2" 14 | "github.com/opentrx/seata-go-samples/order_svc/dao" 15 | "github.com/opentrx/seata-golang/v2/pkg/client" 16 | "github.com/opentrx/seata-golang/v2/pkg/client/config" 17 | "github.com/opentrx/seata-golang/v2/pkg/client/rm" 18 | "github.com/opentrx/seata-golang/v2/pkg/util/log" 19 | 20 | dialector "github.com/opentrx/seata-go-samples/dialector/mysql" 21 | ) 22 | 23 | func main() { 24 | r := gin.Default() 25 | 26 | configPath := os.Getenv("ConfigPath") 27 | conf := config.InitConfiguration(configPath) 28 | 29 | log.Init(conf.Log.LogPath, conf.Log.LogLevel) 30 | client.Init(conf) 31 | 32 | rm.RegisterTransactionServiceServer(mysql.GetDataSourceManager()) 33 | mysql.RegisterResource(config.GetATConfig().DSN) 34 | 35 | db, err := gorm.Open( 36 | dialector.Open(config.GetATConfig().DSN), 37 | &gorm.Config{ 38 | Logger: logger.Default.LogMode(logger.Info), 39 | NamingStrategy: schema.NamingStrategy{ 40 | SingularTable: true, 41 | }}) 42 | if err != nil { 43 | panic(err) 44 | } 45 | DB, err := db.DB() 46 | if err != nil { 47 | panic(err) 48 | } 49 | 50 | DB.SetMaxOpenConns(100) 51 | DB.SetMaxIdleConns(20) 52 | DB.SetConnMaxLifetime(4 * time.Hour) 53 | if err := DB.Ping(); err != nil { 54 | panic(err) 55 | } 56 | d := &dao.Dao{DB: db} 57 | 58 | r.POST("/createSo", func(c *gin.Context) { 59 | type req struct { 60 | Req []*dao.SoMaster 61 | } 62 | var q req 63 | if err := c.ShouldBindJSON(&q); err != nil { 64 | c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) 65 | return 66 | } 67 | 68 | _, err := d.CreateSO( 69 | context.WithValue( 70 | context.Background(), 71 | mysql.XID, 72 | c.Request.Header.Get("XID")), 73 | q.Req) 74 | 75 | if err != nil { 76 | c.JSON(400, gin.H{ 77 | "success": false, 78 | "message": "fail", 79 | }) 80 | } else { 81 | c.JSON(200, gin.H{ 82 | "success": true, 83 | "message": "success", 84 | }) 85 | } 86 | }) 87 | r.Run(":8002") 88 | } 89 | -------------------------------------------------------------------------------- /gorm/product_svc/conf/client.yml: -------------------------------------------------------------------------------- 1 | addressing: productSvc 2 | serverAddressing: localhost:8091 3 | tm: 4 | commitRetryCount: 5 5 | rollbackRetryCount: 5 6 | at: 7 | dsn: "root:123456@tcp(127.0.0.1:3306)/seata_product?timeout=5s&readTimeout=5s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8" 8 | reportRetryCount: 5 9 | reportSuccessEnable: false 10 | lockRetryInterval: 20ms 11 | lockRetryTimes: 30 12 | clientParameters: 13 | time: 10s 14 | timeout: 20s 15 | permitWithoutStream: true 16 | clientTLS: 17 | enable: false 18 | certFilePath: "" 19 | serverName: "test.seata.io" 20 | log: 21 | logPath: /Users/scottlewis/dksl/temp/seata-samples/gorm/product_svc/product.log 22 | logLevel: info -------------------------------------------------------------------------------- /gorm/product_svc/dao/dao.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "context" 5 | "database/sql" 6 | "gorm.io/gorm" 7 | ) 8 | 9 | type Inventory struct { 10 | Sysno uint64 11 | ProductSysno uint64 12 | AccountQty int32 13 | AvailableQty int32 14 | AllocatedQty int32 15 | AdjustLockedQty int32 16 | } 17 | 18 | type Dao struct { 19 | DB *gorm.DB 20 | } 21 | 22 | type AllocateInventoryReq struct { 23 | ProductSysNo int64 24 | Qty int32 25 | } 26 | 27 | func (dao *Dao) AllocateInventory(ctx context.Context, reqs []*AllocateInventoryReq) error { 28 | tx := dao.DB.WithContext(ctx).Begin(&sql.TxOptions{ 29 | Isolation: sql.LevelDefault, 30 | ReadOnly: false, 31 | }) 32 | 33 | for _, req := range reqs { 34 | if err := tx.Model(&Inventory{}). 35 | Where("product_sysno = ? and available_qty >= ?", req.ProductSysNo, req.Qty). 36 | UpdateColumns(map[string]interface{}{ 37 | "available_qty": gorm.Expr("available_qty - ?", req.Qty), 38 | "allocated_qty": gorm.Expr("allocated_qty + ?", req.Qty), 39 | }).Error; err != nil { 40 | tx.Rollback() 41 | return err 42 | } 43 | } 44 | err := tx.Commit().Error 45 | if err != nil { 46 | return err 47 | } 48 | return nil 49 | } 50 | -------------------------------------------------------------------------------- /gorm/product_svc/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "net/http" 6 | "os" 7 | "time" 8 | 9 | "github.com/gin-gonic/gin" 10 | "github.com/opentrx/mysql/v2" 11 | 12 | "github.com/opentrx/seata-golang/v2/pkg/client" 13 | "github.com/opentrx/seata-golang/v2/pkg/client/config" 14 | "github.com/opentrx/seata-golang/v2/pkg/client/rm" 15 | "github.com/opentrx/seata-golang/v2/pkg/util/log" 16 | "gorm.io/gorm" 17 | "gorm.io/gorm/logger" 18 | "gorm.io/gorm/schema" 19 | 20 | dialector "github.com/opentrx/seata-go-samples/dialector/mysql" 21 | "github.com/opentrx/seata-go-samples/product_svc/dao" 22 | ) 23 | 24 | func main() { 25 | r := gin.Default() 26 | 27 | configPath := os.Getenv("ConfigPath") 28 | conf := config.InitConfiguration(configPath) 29 | 30 | log.Init(conf.Log.LogPath, conf.Log.LogLevel) 31 | client.Init(conf) 32 | 33 | rm.RegisterTransactionServiceServer(mysql.GetDataSourceManager()) 34 | mysql.RegisterResource(config.GetATConfig().DSN) 35 | 36 | db, err := gorm.Open( 37 | dialector.Open(config.GetATConfig().DSN), 38 | &gorm.Config{ 39 | Logger: logger.Default.LogMode(logger.Info), 40 | NamingStrategy: schema.NamingStrategy{ 41 | SingularTable: true, 42 | }}) 43 | if err != nil { 44 | panic(err) 45 | } 46 | DB, err := db.DB() 47 | if err != nil { 48 | panic(err) 49 | } 50 | if err := DB.Ping(); err != nil { 51 | panic(err) 52 | } 53 | 54 | DB.SetMaxOpenConns(100) 55 | DB.SetMaxIdleConns(20) 56 | DB.SetConnMaxLifetime(4 * time.Hour) 57 | 58 | d := &dao.Dao{DB: db} 59 | 60 | r.POST("/allocateInventory", func(c *gin.Context) { 61 | type req struct { 62 | Req []*dao.AllocateInventoryReq 63 | } 64 | var q req 65 | if err := c.ShouldBindJSON(&q); err != nil { 66 | c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) 67 | return 68 | } 69 | 70 | err := d.AllocateInventory( 71 | context.WithValue( 72 | context.Background(), 73 | mysql.XID, 74 | c.Request.Header.Get("XID")), 75 | q.Req) 76 | 77 | if err != nil { 78 | c.JSON(400, gin.H{ 79 | "success": false, 80 | "message": "fail", 81 | }) 82 | } else { 83 | c.JSON(200, gin.H{ 84 | "success": true, 85 | "message": "success", 86 | }) 87 | } 88 | }) 89 | 90 | r.Run(":8001") 91 | } 92 | -------------------------------------------------------------------------------- /gorm/scripts/seata_order.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat Premium Data Transfer 3 | 4 | Source Server : local 5 | Source Server Type : MySQL 6 | Source Server Version : 80013 7 | Source Host : localhost:3306 8 | Source Schema : seata_order 9 | 10 | Target Server Type : MySQL 11 | Target Server Version : 80013 12 | File Encoding : 65001 13 | 14 | Date: 07/06/2020 23:07:56 15 | */ 16 | CREATE database if NOT EXISTS `seata_order` default character set utf8mb4 collate utf8mb4_unicode_ci; 17 | use `seata_order`; 18 | 19 | SET NAMES utf8mb4; 20 | SET FOREIGN_KEY_CHECKS = 0; 21 | 22 | -- ---------------------------- 23 | -- Table structure for branch_transaction 24 | -- ---------------------------- 25 | DROP TABLE IF EXISTS `branch_transaction`; 26 | CREATE TABLE `branch_transaction` ( 27 | `sysno` bigint(20) NOT NULL AUTO_INCREMENT, 28 | `xid` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL, 29 | `branch_id` bigint(20) NOT NULL, 30 | `args_json` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 31 | `state` tinyint(4) DEFAULT NULL COMMENT '1,初始化;2,已提交;3,已回滚', 32 | `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 33 | `gmt_modified` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, 34 | PRIMARY KEY (`sysno`) USING BTREE, 35 | UNIQUE KEY `xid` (`xid`,`branch_id`) 36 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='事务记录表'; 37 | 38 | -- ---------------------------- 39 | -- Table structure for so_item 40 | -- ---------------------------- 41 | DROP TABLE IF EXISTS `so_item`; 42 | CREATE TABLE `so_item` ( 43 | `sysno` bigint(20) NOT NULL AUTO_INCREMENT, 44 | `so_sysno` bigint(20) DEFAULT NULL, 45 | `product_sysno` bigint(20) DEFAULT NULL, 46 | `product_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商品名称', 47 | `cost_price` decimal(16,6) DEFAULT NULL COMMENT '成本价', 48 | `original_price` decimal(16,6) DEFAULT NULL COMMENT '原价', 49 | `deal_price` decimal(16,6) DEFAULT NULL COMMENT '成交价', 50 | `quantity` int(11) DEFAULT NULL COMMENT '数量', 51 | PRIMARY KEY (`sysno`) 52 | ) ENGINE=InnoDB AUTO_INCREMENT=1269646673999564801 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='订单明细表'; 53 | 54 | -- ---------------------------- 55 | -- Table structure for so_master 56 | -- ---------------------------- 57 | DROP TABLE IF EXISTS `so_master`; 58 | CREATE TABLE `so_master` ( 59 | `sysno` bigint(20) NOT NULL, 60 | `so_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, 61 | `buyer_user_sysno` bigint(20) DEFAULT NULL COMMENT '下单用户号', 62 | `seller_company_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '卖家公司编号', 63 | `receive_division_sysno` bigint(20) NOT NULL, 64 | `receive_address` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 65 | `receive_zip` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 66 | `receive_contact` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 67 | `receive_contact_phone` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 68 | `stock_sysno` bigint(20) DEFAULT NULL, 69 | `payment_type` tinyint(4) DEFAULT NULL COMMENT '支付方式:1,支付宝,2,微信', 70 | `so_amt` decimal(16,6) DEFAULT NULL COMMENT '订单总额', 71 | `status` tinyint(4) DEFAULT NULL COMMENT '10,创建成功,待支付;30;支付成功,待发货;50;发货成功,待收货;70,确认收货,已完成;90,下单失败;100已作废', 72 | `order_date` timestamp NULL DEFAULT NULL COMMENT '下单时间', 73 | `payment_date` timestamp NULL DEFAULT NULL COMMENT '支付时间', 74 | `delivery_date` timestamp NULL DEFAULT NULL COMMENT '发货时间', 75 | `receive_date` timestamp NULL DEFAULT NULL COMMENT '发货时间', 76 | `appid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '订单来源', 77 | `memo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', 78 | `create_user` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, 79 | `gmt_create` timestamp NULL DEFAULT NULL, 80 | `modify_user` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, 81 | `gmt_modified` timestamp NULL DEFAULT NULL, 82 | PRIMARY KEY (`sysno`) 83 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='订单表'; 84 | 85 | -- ---------------------------- 86 | -- Table structure for undo_log 87 | -- ---------------------------- 88 | DROP TABLE IF EXISTS `undo_log`; 89 | CREATE TABLE `undo_log` ( 90 | `id` bigint(20) NOT NULL AUTO_INCREMENT, 91 | `branch_id` bigint(20) NOT NULL, 92 | `xid` varchar(128) NOT NULL, 93 | `context` varchar(128) NOT NULL, 94 | `rollback_info` longblob NOT NULL, 95 | `log_status` int(11) NOT NULL, 96 | `log_created` datetime NOT NULL, 97 | `log_modified` datetime NOT NULL, 98 | `ext` varchar(100) DEFAULT NULL, 99 | PRIMARY KEY (`id`), 100 | KEY `idx_unionkey` (`xid`,`branch_id`) 101 | ) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; 102 | 103 | SET FOREIGN_KEY_CHECKS = 1; 104 | -------------------------------------------------------------------------------- /gorm/scripts/seata_product.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat Premium Data Transfer 3 | 4 | Source Server : local 5 | Source Server Type : MySQL 6 | Source Server Version : 80013 7 | Source Host : localhost:3306 8 | Source Schema : seata_product 9 | 10 | Target Server Type : MySQL 11 | Target Server Version : 80013 12 | File Encoding : 65001 13 | 14 | Date: 07/06/2020 23:08:54 15 | */ 16 | 17 | CREATE database if NOT EXISTS `seata_product` default character set utf8mb4 collate utf8mb4_unicode_ci; 18 | use `seata_product`; 19 | 20 | SET NAMES utf8mb4; 21 | SET FOREIGN_KEY_CHECKS = 0; 22 | 23 | -- ---------------------------- 24 | -- Table structure for branch_transaction 25 | -- ---------------------------- 26 | DROP TABLE IF EXISTS `branch_transaction`; 27 | CREATE TABLE `branch_transaction` ( 28 | `sysno` bigint(20) NOT NULL AUTO_INCREMENT, 29 | `xid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, 30 | `branch_id` bigint(20) NOT NULL, 31 | `args_json` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, 32 | `state` tinyint(4) DEFAULT NULL COMMENT '1,初始化;2,已提交;3,已回滚', 33 | `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 34 | `gmt_modified` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, 35 | PRIMARY KEY (`sysno`) USING BTREE, 36 | UNIQUE KEY `xid` (`xid`,`branch_id`) 37 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='事务记录表'; 38 | 39 | -- ---------------------------- 40 | -- Table structure for inventory 41 | -- ---------------------------- 42 | DROP TABLE IF EXISTS `inventory`; 43 | CREATE TABLE `inventory` ( 44 | `sysno` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', 45 | `product_sysno` bigint(20) unsigned NOT NULL, 46 | `account_qty` int(11) DEFAULT NULL COMMENT '财务库存', 47 | `available_qty` int(11) DEFAULT NULL COMMENT '可用库存', 48 | `allocated_qty` int(11) DEFAULT NULL COMMENT '分配库存', 49 | `adjust_locked_qty` int(11) DEFAULT NULL COMMENT '调整锁定库存', 50 | PRIMARY KEY (`sysno`) 51 | ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='商品库存'; 52 | 53 | -- ---------------------------- 54 | -- Records of inventory 55 | -- ---------------------------- 56 | BEGIN; 57 | INSERT INTO `inventory` VALUES (1, 1, 1000000, 1000000, 0, 0); 58 | COMMIT; 59 | 60 | -- ---------------------------- 61 | -- Table structure for product 62 | -- ---------------------------- 63 | DROP TABLE IF EXISTS `product`; 64 | CREATE TABLE `product` ( 65 | `sysno` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', 66 | `product_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '品名', 67 | `product_title` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, 68 | `product_desc` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '描述', 69 | `product_desc_long` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '描述', 70 | `default_image_src` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 71 | `c3_sysno` bigint(20) DEFAULT NULL, 72 | `barcode` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 73 | `length` int(11) DEFAULT NULL, 74 | `width` int(11) DEFAULT NULL, 75 | `height` int(11) DEFAULT NULL, 76 | `weight` float DEFAULT NULL, 77 | `merchant_sysno` bigint(20) DEFAULT NULL, 78 | `merchant_productid` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 79 | `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1,待上架;2,上架;3,下架;4,售罄下架;5,违规下架', 80 | `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', 81 | `create_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '创建人', 82 | `modify_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '修改人', 83 | `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', 84 | PRIMARY KEY (`sysno`) 85 | ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='商品SKU'; 86 | 87 | -- ---------------------------- 88 | -- Records of product 89 | -- ---------------------------- 90 | BEGIN; 91 | INSERT INTO `product` VALUES (1, '刺力王', '从小喝到大的刺力王', '好喝好喝好好喝', '', 'https://img10.360buyimg.com/mobilecms/s500x500_jfs/t1/61921/34/1166/131384/5cf60a94E411eee07/1ee010f4142236c3.jpg', 0, '', 15, 5, 5, 5, 1, '', 1, '2019-05-28 03:36:17', '', '', '2019-06-06 01:37:36'); 92 | COMMIT; 93 | 94 | -- ---------------------------- 95 | -- Table structure for undo_log 96 | -- ---------------------------- 97 | DROP TABLE IF EXISTS `undo_log`; 98 | CREATE TABLE `undo_log` ( 99 | `id` bigint(20) NOT NULL AUTO_INCREMENT, 100 | `branch_id` bigint(20) NOT NULL, 101 | `xid` varchar(128) NOT NULL, 102 | `context` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, 103 | `rollback_info` longblob NOT NULL, 104 | `log_status` int(11) NOT NULL, 105 | `log_created` datetime NOT NULL, 106 | `log_modified` datetime NOT NULL, 107 | `ext` varchar(100) DEFAULT NULL, 108 | PRIMARY KEY (`id`), 109 | KEY `idx_unionkey` (`xid`,`branch_id`) 110 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 111 | 112 | SET FOREIGN_KEY_CHECKS = 1; 113 | -------------------------------------------------------------------------------- /http/aggregation_svc/conf/config.yml: -------------------------------------------------------------------------------- 1 | addressing: aggregationSvc 2 | serverAddressing: localhost:8091 3 | tm: 4 | commitRetryCount: 5 5 | rollbackRetryCount: 5 6 | clientParameters: 7 | time: 10s 8 | timeout: 20s 9 | permitWithoutStream: true 10 | clientTLS: 11 | enable: false 12 | certFilePath: "" 13 | serverName: "test.seata.io" 14 | log: 15 | logPath: /Users/scottlewis/dksl/temp/seata-samples/http/aggregation_svc/aggregation.log 16 | logLevel: info -------------------------------------------------------------------------------- /http/aggregation_svc/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/gin-gonic/gin" 7 | "github.com/opentrx/seata-golang/v2/pkg/client" 8 | "github.com/opentrx/seata-golang/v2/pkg/client/config" 9 | "github.com/opentrx/seata-golang/v2/pkg/client/tm" 10 | "github.com/opentrx/seata-golang/v2/pkg/util/log" 11 | 12 | "github.com/opentrx/seata-go-samples/aggregation_svc/svc" 13 | ) 14 | 15 | func main() { 16 | r := gin.Default() 17 | 18 | configPath := os.Getenv("ConfigPath") 19 | conf := config.InitConfiguration(configPath) 20 | 21 | log.Init(conf.Log.LogPath, conf.Log.LogLevel) 22 | client.Init(conf) 23 | 24 | tm.Implement(svc.ProxySvc) 25 | 26 | r.GET("/createSoCommit", func(c *gin.Context) { 27 | 28 | svc.ProxySvc.CreateSo(c, false) 29 | 30 | c.JSON(200, gin.H{ 31 | "success": true, 32 | "message": "success", 33 | }) 34 | }) 35 | 36 | r.GET("/createSoRollback", func(c *gin.Context) { 37 | 38 | svc.ProxySvc.CreateSo(c, true) 39 | 40 | c.JSON(200, gin.H{ 41 | "success": true, 42 | "message": "success", 43 | }) 44 | }) 45 | 46 | r.Run(":8003") 47 | } 48 | -------------------------------------------------------------------------------- /http/aggregation_svc/svc/svc.go: -------------------------------------------------------------------------------- 1 | package svc 2 | 3 | import ( 4 | "bytes" 5 | "context" 6 | "encoding/json" 7 | "errors" 8 | "fmt" 9 | "net/http" 10 | 11 | context2 "github.com/opentrx/seata-golang/v2/pkg/client/base/context" 12 | "github.com/opentrx/seata-golang/v2/pkg/client/base/model" 13 | 14 | "github.com/opentrx/seata-go-samples/order_svc/dao" 15 | dao2 "github.com/opentrx/seata-go-samples/product_svc/dao" 16 | ) 17 | 18 | type Svc struct { 19 | } 20 | 21 | func (svc *Svc) CreateSo(ctx context.Context, rollback bool) error { 22 | rootContext := ctx.(*context2.RootContext) 23 | soMasters := []*dao.SoMaster{ 24 | { 25 | BuyerUserSysNo: 10001, 26 | SellerCompanyCode: "SC001", 27 | ReceiveDivisionSysNo: 110105, 28 | ReceiveAddress: "朝阳区长安街001号", 29 | ReceiveZip: "000001", 30 | ReceiveContact: "斯密达", 31 | ReceiveContactPhone: "18728828296", 32 | StockSysNo: 1, 33 | PaymentType: 1, 34 | SoAmt: 430.5, 35 | Status: 10, 36 | AppID: "dk-order", 37 | SoItems: []*dao.SoItem{ 38 | { 39 | ProductSysNo: 1, 40 | ProductName: "刺力王", 41 | CostPrice: 200, 42 | OriginalPrice: 232, 43 | DealPrice: 215.25, 44 | Quantity: 2, 45 | }, 46 | }, 47 | }, 48 | } 49 | 50 | reqs := []*dao2.AllocateInventoryReq{{ 51 | ProductSysNo: 1, 52 | Qty: 2, 53 | }} 54 | 55 | type rq1 struct { 56 | Req []*dao.SoMaster 57 | } 58 | 59 | type rq2 struct { 60 | Req []*dao2.AllocateInventoryReq 61 | } 62 | 63 | q1 := &rq1{Req: soMasters} 64 | soReq, err := json.Marshal(q1) 65 | fmt.Println(string(soReq)) 66 | req1, err := http.NewRequest("POST", "http://localhost:8002/createSo", bytes.NewBuffer(soReq)) 67 | if err != nil { 68 | panic(err) 69 | } 70 | req1.Header.Set("Content-Type", "application/json") 71 | req1.Header.Set("xid", rootContext.GetXID()) 72 | 73 | client := &http.Client{} 74 | result1, err1 := client.Do(req1) 75 | if err1 != nil { 76 | return err1 77 | } 78 | 79 | if result1.StatusCode == 400 { 80 | return errors.New("err") 81 | } 82 | 83 | q2 := &rq2{ 84 | Req: reqs, 85 | } 86 | ivtReq, _ := json.Marshal(q2) 87 | fmt.Println(string(ivtReq)) 88 | req2, err := http.NewRequest("POST", "http://localhost:8001/allocateInventory", bytes.NewBuffer(ivtReq)) 89 | if err != nil { 90 | panic(err) 91 | } 92 | req2.Header.Set("Content-Type", "application/json") 93 | req2.Header.Set("xid", rootContext.GetXID()) 94 | 95 | result2, err2 := client.Do(req2) 96 | if err2 != nil { 97 | return err2 98 | } 99 | 100 | if result2.StatusCode == 400 { 101 | return errors.New("err") 102 | } 103 | 104 | if rollback { 105 | return errors.New("there is a error") 106 | } 107 | return nil 108 | } 109 | 110 | var service = &Svc{} 111 | 112 | type ProxyService struct { 113 | *Svc 114 | CreateSo func(ctx context.Context, rollback bool) error 115 | } 116 | 117 | var methodTransactionInfo = make(map[string]*model.TransactionInfo) 118 | 119 | func init() { 120 | methodTransactionInfo["CreateSo"] = &model.TransactionInfo{ 121 | TimeOut: 300000, 122 | Name: "CreateSo", 123 | Propagation: model.Required, 124 | } 125 | } 126 | 127 | func (svc *ProxyService) GetProxyService() interface{} { 128 | return svc.Svc 129 | } 130 | 131 | func (svc *ProxyService) GetMethodTransactionInfo(methodName string) *model.TransactionInfo { 132 | return methodTransactionInfo[methodName] 133 | } 134 | 135 | var ProxySvc = &ProxyService{ 136 | Svc: service, 137 | } 138 | -------------------------------------------------------------------------------- /http/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/opentrx/seata-go-samples 2 | 3 | go 1.15 4 | 5 | require ( 6 | github.com/gin-gonic/gin v1.6.3 7 | github.com/google/uuid v1.2.0 8 | github.com/opentrx/mysql/v2 v2.0.7 9 | github.com/opentrx/seata-golang/v2 v2.0.7-rc3 10 | github.com/pingcap/check v0.0.0-20200212061837-5e12011dc712 // indirect 11 | github.com/pingcap/errors v0.11.5-0.20190809092503-95897b64e011 // indirect 12 | github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd // indirect 13 | ) -------------------------------------------------------------------------------- /http/order_svc/conf/config.yml: -------------------------------------------------------------------------------- 1 | addressing: orderSvc 2 | serverAddressing: localhost:8091 3 | tm: 4 | commitRetryCount: 5 5 | rollbackRetryCount: 5 6 | at: 7 | dsn: "root:123456@tcp(127.0.0.1:3306)/seata_order?timeout=5s&readTimeout=5s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8" 8 | reportRetryCount: 5 9 | reportSuccessEnable: false 10 | lockRetryInterval: 20ms 11 | lockRetryTimes: 30 12 | enforcementPolicy: 13 | minTime: 5m 14 | permitWithoutStream: true 15 | serverParameters: 16 | maxConnectionIdle: 15s 17 | maxConnectionAge: 30s 18 | maxConnectionAgeGrace: 5s 19 | time: 5s 20 | timeout: 20s 21 | clientParameters: 22 | time: 10s 23 | timeout: 20s 24 | permitWithoutStream: true 25 | clientTLS: 26 | enable: false 27 | certFilePath: "" 28 | serverName: "test.seata.io" 29 | log: 30 | logPath: /Users/scottlewis/dksl/temp/seata-samples/http/order_svc/order.log 31 | logLevel: info -------------------------------------------------------------------------------- /http/order_svc/dao/dao.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "context" 5 | "database/sql" 6 | "github.com/opentrx/seata-golang/v2/pkg/util/log" 7 | "time" 8 | ) 9 | 10 | import ( 11 | "github.com/google/uuid" 12 | ) 13 | 14 | const ( 15 | insertSoMaster = `INSERT INTO seata_order.so_master (sysno, so_id, buyer_user_sysno, seller_company_code, 16 | receive_division_sysno, receive_address, receive_zip, receive_contact, receive_contact_phone, stock_sysno, 17 | payment_type, so_amt, status, order_date, appid, memo) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,now(),?,?)` 18 | insertSoItem = `INSERT INTO seata_order.so_item(sysno, so_sysno, product_sysno, product_name, cost_price, 19 | original_price, deal_price, quantity) VALUES (?,?,?,?,?,?,?,?)` 20 | ) 21 | 22 | type Dao struct { 23 | *sql.DB 24 | } 25 | 26 | //现实中涉及金额可能使用长整形,这里使用 float64 仅作测试,不具有参考意义 27 | 28 | type SoMaster struct { 29 | SysNo int64 `json:"sysNo"` 30 | SoID string `json:"soID"` 31 | BuyerUserSysNo int64 `json:"buyerUserSysNo"` 32 | SellerCompanyCode string `json:"sellerCompanyCode"` 33 | ReceiveDivisionSysNo int64 `json:"receiveDivisionSysNo"` 34 | ReceiveAddress string `json:"receiveAddress"` 35 | ReceiveZip string `json:"receiveZip"` 36 | ReceiveContact string `json:"receiveContact"` 37 | ReceiveContactPhone string `json:"receiveContactPhone"` 38 | StockSysNo int64 `json:"stockSysNo"` 39 | PaymentType int32 `json:"paymentType"` 40 | SoAmt float64 `json:"soAmt"` 41 | //10,创建成功,待支付;30;支付成功,待发货;50;发货成功,待收货;70,确认收货,已完成;90,下单失败;100已作废 42 | Status int32 `json:"status"` 43 | OrderDate time.Time `json:"orderDate"` 44 | PaymentDate time.Time `json:"paymentDate"` 45 | DeliveryDate time.Time `json:"deliveryDate"` 46 | ReceiveDate time.Time `json:"receiveDate"` 47 | AppID string `json:"appID"` 48 | Memo string `json:"memo"` 49 | CreateUser string `json:"createUser"` 50 | GmtCreate time.Time `json:"gmtCreate"` 51 | ModifyUser string `json:"modifyUser"` 52 | GmtModified time.Time `json:"gmtModified"` 53 | 54 | SoItems []*SoItem 55 | } 56 | 57 | type SoItem struct { 58 | SysNo int64 `json:"sysNo"` 59 | SoSysNo int64 `json:"soSysNo"` 60 | ProductSysNo int64 `json:"productSysNo"` 61 | ProductName string `json:"productName"` 62 | CostPrice float64 `json:"costPrice"` 63 | OriginalPrice float64 `json:"originalPrice"` 64 | DealPrice float64 `json:"dealPrice"` 65 | Quantity int32 `json:"quantity"` 66 | } 67 | 68 | func (dao *Dao) CreateSO(ctx context.Context, soMasters []*SoMaster) ([]uint64, error) { 69 | result := make([]uint64, 0, len(soMasters)) 70 | tx, err := dao.BeginTx(ctx, &sql.TxOptions{ 71 | Isolation: sql.LevelDefault, 72 | ReadOnly: false, 73 | }) 74 | if err != nil { 75 | return nil, err 76 | } 77 | for _, soMaster := range soMasters { 78 | soid := NextID() 79 | _, err = tx.Exec(insertSoMaster, soid, soid, soMaster.BuyerUserSysNo, soMaster.SellerCompanyCode, soMaster.ReceiveDivisionSysNo, 80 | soMaster.ReceiveAddress, soMaster.ReceiveZip, soMaster.ReceiveContact, soMaster.ReceiveContactPhone, soMaster.StockSysNo, 81 | soMaster.PaymentType, soMaster.SoAmt, soMaster.Status, soMaster.AppID, soMaster.Memo) 82 | if err != nil { 83 | tx.Rollback() 84 | return nil, err 85 | } 86 | soItems := soMaster.SoItems 87 | for _, soItem := range soItems { 88 | soItemID := NextID() 89 | _, err = tx.Exec(insertSoItem, soItemID, soid, soItem.ProductSysNo, soItem.ProductName, soItem.CostPrice, soItem.OriginalPrice, 90 | soItem.DealPrice, soItem.Quantity) 91 | if err != nil { 92 | tx.Rollback() 93 | return nil, err 94 | } 95 | } 96 | result = append(result, soid) 97 | } 98 | err = tx.Commit() 99 | if err != nil { 100 | log.Error(err) 101 | return nil, err 102 | } 103 | return result, nil 104 | } 105 | 106 | func NextID() uint64 { 107 | id, _ := uuid.NewUUID() 108 | return uint64(id.ID()) 109 | } 110 | -------------------------------------------------------------------------------- /http/order_svc/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "database/sql" 6 | "net/http" 7 | "os" 8 | "time" 9 | 10 | "github.com/gin-gonic/gin" 11 | "github.com/opentrx/mysql/v2" 12 | "github.com/opentrx/seata-golang/v2/pkg/client" 13 | "github.com/opentrx/seata-golang/v2/pkg/client/config" 14 | "github.com/opentrx/seata-golang/v2/pkg/client/rm" 15 | "github.com/opentrx/seata-golang/v2/pkg/util/log" 16 | 17 | "github.com/opentrx/seata-go-samples/order_svc/dao" 18 | ) 19 | 20 | func main() { 21 | r := gin.Default() 22 | 23 | configPath := os.Getenv("ConfigPath") 24 | conf := config.InitConfiguration(configPath) 25 | log.Init(conf.Log.LogPath, conf.Log.LogLevel) 26 | client.Init(conf) 27 | rm.RegisterTransactionServiceServer(mysql.GetDataSourceManager()) 28 | mysql.RegisterResource(config.GetATConfig().DSN) 29 | 30 | sqlDB, err := sql.Open("mysql", config.GetATConfig().DSN) 31 | if err != nil { 32 | panic(err) 33 | } 34 | sqlDB.SetMaxOpenConns(100) 35 | sqlDB.SetMaxIdleConns(20) 36 | sqlDB.SetConnMaxLifetime(4 * time.Hour) 37 | 38 | d := &dao.Dao{ 39 | DB: sqlDB, 40 | } 41 | 42 | r.POST("/createSo", func(c *gin.Context) { 43 | type req struct { 44 | Req []*dao.SoMaster 45 | } 46 | var q req 47 | if err := c.ShouldBindJSON(&q); err != nil { 48 | c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) 49 | return 50 | } 51 | 52 | _, err := d.CreateSO( 53 | context.WithValue( 54 | context.Background(), 55 | mysql.XID, 56 | c.Request.Header.Get("XID")), 57 | q.Req) 58 | 59 | if err != nil { 60 | c.JSON(400, gin.H{ 61 | "success": false, 62 | "message": "fail", 63 | }) 64 | } else { 65 | c.JSON(200, gin.H{ 66 | "success": true, 67 | "message": "success", 68 | }) 69 | } 70 | }) 71 | r.Run(":8002") 72 | } 73 | -------------------------------------------------------------------------------- /http/product_svc/conf/config.yml: -------------------------------------------------------------------------------- 1 | addressing: productSvc 2 | serverAddressing: localhost:8091 3 | tm: 4 | commitRetryCount: 5 5 | rollbackRetryCount: 5 6 | at: 7 | dsn: "root:123456@tcp(127.0.0.1:3306)/seata_product?timeout=5s&readTimeout=5s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8" 8 | reportRetryCount: 5 9 | reportSuccessEnable: false 10 | lockRetryInterval: 20ms 11 | lockRetryTimes: 30 12 | enforcementPolicy: 13 | minTime: 5m 14 | permitWithoutStream: true 15 | serverParameters: 16 | maxConnectionIdle: 15s 17 | maxConnectionAge: 30s 18 | maxConnectionAgeGrace: 5s 19 | time: 5s 20 | timeout: 20s 21 | clientParameters: 22 | time: 10s 23 | timeout: 20s 24 | permitWithoutStream: true 25 | clientTLS: 26 | enable: false 27 | certFilePath: "" 28 | serverName: "test.seata.io" 29 | log: 30 | logPath: /Users/scottlewis/dksl/temp/seata-samples/http/product_svc/product.log 31 | logLevel: info 32 | -------------------------------------------------------------------------------- /http/product_svc/dao/dao.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "context" 5 | "database/sql" 6 | "github.com/opentrx/seata-golang/v2/pkg/util/log" 7 | ) 8 | 9 | const ( 10 | allocateInventorySql = `update seata_product.inventory set available_qty = available_qty - ?, 11 | allocated_qty = allocated_qty + ? where product_sysno = ? and available_qty >= ?` 12 | ) 13 | 14 | type Dao struct { 15 | *sql.DB 16 | } 17 | 18 | type AllocateInventoryReq struct { 19 | ProductSysNo int64 20 | Qty int32 21 | } 22 | 23 | func (dao *Dao) AllocateInventory(ctx context.Context, reqs []*AllocateInventoryReq) error { 24 | tx, err := dao.BeginTx(ctx, &sql.TxOptions{ 25 | Isolation: sql.LevelDefault, 26 | ReadOnly: false, 27 | }) 28 | if err != nil { 29 | return err 30 | } 31 | for _, req := range reqs { 32 | _, err := tx.Exec(allocateInventorySql, req.Qty, req.Qty, req.ProductSysNo, req.Qty) 33 | if err != nil { 34 | tx.Rollback() 35 | return err 36 | } 37 | } 38 | err = tx.Commit() 39 | if err != nil { 40 | log.Error(err) 41 | return err 42 | } 43 | return nil 44 | } 45 | -------------------------------------------------------------------------------- /http/product_svc/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "database/sql" 6 | "net/http" 7 | "os" 8 | "time" 9 | 10 | "github.com/gin-gonic/gin" 11 | "github.com/opentrx/mysql/v2" 12 | "github.com/opentrx/seata-golang/v2/pkg/client" 13 | "github.com/opentrx/seata-golang/v2/pkg/client/config" 14 | "github.com/opentrx/seata-golang/v2/pkg/client/rm" 15 | "github.com/opentrx/seata-golang/v2/pkg/util/log" 16 | 17 | "github.com/opentrx/seata-go-samples/product_svc/dao" 18 | ) 19 | 20 | 21 | func main() { 22 | r := gin.Default() 23 | 24 | configPath := os.Getenv("ConfigPath") 25 | conf := config.InitConfiguration(configPath) 26 | 27 | log.Init(conf.Log.LogPath, conf.Log.LogLevel) 28 | client.Init(conf) 29 | 30 | rm.RegisterTransactionServiceServer(mysql.GetDataSourceManager()) 31 | mysql.RegisterResource(config.GetATConfig().DSN) 32 | 33 | sqlDB, err := sql.Open("mysql", config.GetATConfig().DSN) 34 | if err != nil { 35 | panic(err) 36 | } 37 | sqlDB.SetMaxOpenConns(100) 38 | sqlDB.SetMaxIdleConns(20) 39 | sqlDB.SetConnMaxLifetime(4 * time.Hour) 40 | 41 | if err != nil { 42 | panic(err) 43 | } 44 | d := &dao.Dao{ 45 | DB: sqlDB, 46 | } 47 | 48 | r.POST("/allocateInventory", func(c *gin.Context) { 49 | type req struct { 50 | Req []*dao.AllocateInventoryReq 51 | } 52 | var q req 53 | if err := c.ShouldBindJSON(&q); err != nil { 54 | c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) 55 | return 56 | } 57 | 58 | 59 | err := d.AllocateInventory( 60 | context.WithValue( 61 | context.Background(), 62 | mysql.XID, 63 | c.Request.Header.Get("XID")), 64 | q.Req) 65 | 66 | if err != nil { 67 | c.JSON(400, gin.H{ 68 | "success": false, 69 | "message": "fail", 70 | }) 71 | } else { 72 | c.JSON(200, gin.H{ 73 | "success": true, 74 | "message": "success", 75 | }) 76 | } 77 | }) 78 | 79 | r.Run(":8001") 80 | } 81 | -------------------------------------------------------------------------------- /http/scripts/seata_order.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat Premium Data Transfer 3 | 4 | Source Server : local 5 | Source Server Type : MySQL 6 | Source Server Version : 80013 7 | Source Host : localhost:3306 8 | Source Schema : seata_order 9 | 10 | Target Server Type : MySQL 11 | Target Server Version : 80013 12 | File Encoding : 65001 13 | 14 | Date: 07/06/2020 23:07:56 15 | */ 16 | CREATE database if NOT EXISTS `seata_order` default character set utf8mb4 collate utf8mb4_unicode_ci; 17 | use `seata_order`; 18 | 19 | SET NAMES utf8mb4; 20 | SET FOREIGN_KEY_CHECKS = 0; 21 | 22 | -- ---------------------------- 23 | -- Table structure for branch_transaction 24 | -- ---------------------------- 25 | DROP TABLE IF EXISTS `branch_transaction`; 26 | CREATE TABLE `branch_transaction` ( 27 | `sysno` bigint(20) NOT NULL AUTO_INCREMENT, 28 | `xid` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL, 29 | `branch_id` bigint(20) NOT NULL, 30 | `args_json` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 31 | `state` tinyint(4) DEFAULT NULL COMMENT '1,初始化;2,已提交;3,已回滚', 32 | `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 33 | `gmt_modified` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, 34 | PRIMARY KEY (`sysno`) USING BTREE, 35 | UNIQUE KEY `xid` (`xid`,`branch_id`) 36 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='事务记录表'; 37 | 38 | -- ---------------------------- 39 | -- Table structure for so_item 40 | -- ---------------------------- 41 | DROP TABLE IF EXISTS `so_item`; 42 | CREATE TABLE `so_item` ( 43 | `sysno` bigint(20) NOT NULL AUTO_INCREMENT, 44 | `so_sysno` bigint(20) DEFAULT NULL, 45 | `product_sysno` bigint(20) DEFAULT NULL, 46 | `product_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商品名称', 47 | `cost_price` decimal(16,6) DEFAULT NULL COMMENT '成本价', 48 | `original_price` decimal(16,6) DEFAULT NULL COMMENT '原价', 49 | `deal_price` decimal(16,6) DEFAULT NULL COMMENT '成交价', 50 | `quantity` int(11) DEFAULT NULL COMMENT '数量', 51 | PRIMARY KEY (`sysno`) 52 | ) ENGINE=InnoDB AUTO_INCREMENT=1269646673999564801 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='订单明细表'; 53 | 54 | -- ---------------------------- 55 | -- Table structure for so_master 56 | -- ---------------------------- 57 | DROP TABLE IF EXISTS `so_master`; 58 | CREATE TABLE `so_master` ( 59 | `sysno` bigint(20) NOT NULL, 60 | `so_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, 61 | `buyer_user_sysno` bigint(20) DEFAULT NULL COMMENT '下单用户号', 62 | `seller_company_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '卖家公司编号', 63 | `receive_division_sysno` bigint(20) NOT NULL, 64 | `receive_address` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 65 | `receive_zip` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 66 | `receive_contact` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 67 | `receive_contact_phone` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 68 | `stock_sysno` bigint(20) DEFAULT NULL, 69 | `payment_type` tinyint(4) DEFAULT NULL COMMENT '支付方式:1,支付宝,2,微信', 70 | `so_amt` decimal(16,6) DEFAULT NULL COMMENT '订单总额', 71 | `status` tinyint(4) DEFAULT NULL COMMENT '10,创建成功,待支付;30;支付成功,待发货;50;发货成功,待收货;70,确认收货,已完成;90,下单失败;100已作废', 72 | `order_date` timestamp NULL DEFAULT NULL COMMENT '下单时间', 73 | `payment_date` timestamp NULL DEFAULT NULL COMMENT '支付时间', 74 | `delivery_date` timestamp NULL DEFAULT NULL COMMENT '发货时间', 75 | `receive_date` timestamp NULL DEFAULT NULL COMMENT '发货时间', 76 | `appid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '订单来源', 77 | `memo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', 78 | `create_user` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, 79 | `gmt_create` timestamp NULL DEFAULT NULL, 80 | `modify_user` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, 81 | `gmt_modified` timestamp NULL DEFAULT NULL, 82 | PRIMARY KEY (`sysno`) 83 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='订单表'; 84 | 85 | -- ---------------------------- 86 | -- Table structure for undo_log 87 | -- ---------------------------- 88 | DROP TABLE IF EXISTS `undo_log`; 89 | CREATE TABLE `undo_log` ( 90 | `id` bigint(20) NOT NULL AUTO_INCREMENT, 91 | `branch_id` bigint(20) NOT NULL, 92 | `xid` varchar(128) NOT NULL, 93 | `context` varchar(128) NOT NULL, 94 | `rollback_info` longblob NOT NULL, 95 | `log_status` int(11) NOT NULL, 96 | `log_created` datetime NOT NULL, 97 | `log_modified` datetime NOT NULL, 98 | `ext` varchar(100) DEFAULT NULL, 99 | PRIMARY KEY (`id`), 100 | KEY `idx_unionkey` (`xid`,`branch_id`) 101 | ) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; 102 | 103 | SET FOREIGN_KEY_CHECKS = 1; 104 | -------------------------------------------------------------------------------- /http/scripts/seata_product.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat Premium Data Transfer 3 | 4 | Source Server : local 5 | Source Server Type : MySQL 6 | Source Server Version : 80013 7 | Source Host : localhost:3306 8 | Source Schema : seata_product 9 | 10 | Target Server Type : MySQL 11 | Target Server Version : 80013 12 | File Encoding : 65001 13 | 14 | Date: 07/06/2020 23:08:54 15 | */ 16 | 17 | CREATE database if NOT EXISTS `seata_product` default character set utf8mb4 collate utf8mb4_unicode_ci; 18 | use `seata_product`; 19 | 20 | SET NAMES utf8mb4; 21 | SET FOREIGN_KEY_CHECKS = 0; 22 | 23 | -- ---------------------------- 24 | -- Table structure for branch_transaction 25 | -- ---------------------------- 26 | DROP TABLE IF EXISTS `branch_transaction`; 27 | CREATE TABLE `branch_transaction` ( 28 | `sysno` bigint(20) NOT NULL AUTO_INCREMENT, 29 | `xid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, 30 | `branch_id` bigint(20) NOT NULL, 31 | `args_json` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, 32 | `state` tinyint(4) DEFAULT NULL COMMENT '1,初始化;2,已提交;3,已回滚', 33 | `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 34 | `gmt_modified` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, 35 | PRIMARY KEY (`sysno`) USING BTREE, 36 | UNIQUE KEY `xid` (`xid`,`branch_id`) 37 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='事务记录表'; 38 | 39 | -- ---------------------------- 40 | -- Table structure for inventory 41 | -- ---------------------------- 42 | DROP TABLE IF EXISTS `inventory`; 43 | CREATE TABLE `inventory` ( 44 | `sysno` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', 45 | `product_sysno` bigint(20) unsigned NOT NULL, 46 | `account_qty` int(11) DEFAULT NULL COMMENT '财务库存', 47 | `available_qty` int(11) DEFAULT NULL COMMENT '可用库存', 48 | `allocated_qty` int(11) DEFAULT NULL COMMENT '分配库存', 49 | `adjust_locked_qty` int(11) DEFAULT NULL COMMENT '调整锁定库存', 50 | PRIMARY KEY (`sysno`) 51 | ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='商品库存'; 52 | 53 | -- ---------------------------- 54 | -- Records of inventory 55 | -- ---------------------------- 56 | BEGIN; 57 | INSERT INTO `inventory` VALUES (1, 1, 1000000, 1000000, 0, 0); 58 | COMMIT; 59 | 60 | -- ---------------------------- 61 | -- Table structure for product 62 | -- ---------------------------- 63 | DROP TABLE IF EXISTS `product`; 64 | CREATE TABLE `product` ( 65 | `sysno` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', 66 | `product_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '品名', 67 | `product_title` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, 68 | `product_desc` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '描述', 69 | `product_desc_long` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '描述', 70 | `default_image_src` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 71 | `c3_sysno` bigint(20) DEFAULT NULL, 72 | `barcode` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 73 | `length` int(11) DEFAULT NULL, 74 | `width` int(11) DEFAULT NULL, 75 | `height` int(11) DEFAULT NULL, 76 | `weight` float DEFAULT NULL, 77 | `merchant_sysno` bigint(20) DEFAULT NULL, 78 | `merchant_productid` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 79 | `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1,待上架;2,上架;3,下架;4,售罄下架;5,违规下架', 80 | `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', 81 | `create_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '创建人', 82 | `modify_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '修改人', 83 | `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', 84 | PRIMARY KEY (`sysno`) 85 | ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='商品SKU'; 86 | 87 | -- ---------------------------- 88 | -- Records of product 89 | -- ---------------------------- 90 | BEGIN; 91 | INSERT INTO `product` VALUES (1, '刺力王', '从小喝到大的刺力王', '好喝好喝好好喝', '', 'https://img10.360buyimg.com/mobilecms/s500x500_jfs/t1/61921/34/1166/131384/5cf60a94E411eee07/1ee010f4142236c3.jpg', 0, '', 15, 5, 5, 5, 1, '', 1, '2019-05-28 03:36:17', '', '', '2019-06-06 01:37:36'); 92 | COMMIT; 93 | 94 | -- ---------------------------- 95 | -- Table structure for undo_log 96 | -- ---------------------------- 97 | DROP TABLE IF EXISTS `undo_log`; 98 | CREATE TABLE `undo_log` ( 99 | `id` bigint(20) NOT NULL AUTO_INCREMENT, 100 | `branch_id` bigint(20) NOT NULL, 101 | `xid` varchar(128) NOT NULL, 102 | `context` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, 103 | `rollback_info` longblob NOT NULL, 104 | `log_status` int(11) NOT NULL, 105 | `log_created` datetime NOT NULL, 106 | `log_modified` datetime NOT NULL, 107 | `ext` varchar(100) DEFAULT NULL, 108 | PRIMARY KEY (`id`), 109 | KEY `idx_unionkey` (`xid`,`branch_id`) 110 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 111 | 112 | SET FOREIGN_KEY_CHECKS = 1; 113 | -------------------------------------------------------------------------------- /tcc-remote/conf/config1.yml: -------------------------------------------------------------------------------- 1 | port: 8081 2 | addressing: localhost:8081 3 | serverAddressing: localhost:8091 4 | tm: 5 | commitRetryCount: 5 6 | rollbackRetryCount: 5 7 | enforcementPolicy: 8 | minTime: 5s 9 | permitWithoutStream: true 10 | serverParameters: 11 | maxConnectionIdle: 15s 12 | maxConnectionAge: 30s 13 | maxConnectionAgeGrace: 5s 14 | time: 5s 15 | timeout: 1s 16 | clientTLS: 17 | enable: false 18 | certFilePath: "" 19 | serverName: "test.seata.io" 20 | clientParameters: 21 | time: 10s 22 | timeout: 1s 23 | permitWithoutStream: true 24 | -------------------------------------------------------------------------------- /tcc-remote/conf/config2.yml: -------------------------------------------------------------------------------- 1 | port: 8082 2 | addressing: localhost:8082 3 | serverAddressing: localhost:8091 4 | tm: 5 | commitRetryCount: 5 6 | rollbackRetryCount: 5 7 | enforcementPolicy: 8 | minTime: 5s 9 | permitWithoutStream: true 10 | serverParameters: 11 | maxConnectionIdle: 15s 12 | maxConnectionAge: 30s 13 | maxConnectionAgeGrace: 5s 14 | time: 5s 15 | timeout: 1s 16 | clientTLS: 17 | enable: false 18 | certFilePath: "" 19 | serverName: "test.seata.io" 20 | clientParameters: 21 | time: 10s 22 | timeout: 1s 23 | permitWithoutStream: true 24 | -------------------------------------------------------------------------------- /tcc-remote/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/opentrx/seata-go-samples 2 | 3 | go 1.15 4 | 5 | require ( 6 | github.com/gin-gonic/gin v1.6.3 7 | github.com/opentrx/seata-golang/v2 v2.0.7-rc3 8 | ) -------------------------------------------------------------------------------- /tcc-remote/go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 3 | cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw= 4 | cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= 5 | cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= 6 | cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= 7 | cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= 8 | cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= 9 | cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= 10 | cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= 11 | cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= 12 | cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= 13 | cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= 14 | dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 15 | gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:EXuID2Zs0pAQhH8yz+DNjUbjppKQzKFAn28TMYPB6IU= 16 | github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= 17 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 18 | github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 19 | github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= 20 | github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= 21 | github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= 22 | github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= 23 | github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= 24 | github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= 25 | github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= 26 | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 27 | github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 28 | github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 29 | github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 30 | github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= 31 | github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk= 32 | github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= 33 | github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= 34 | github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= 35 | github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= 36 | github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= 37 | github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= 38 | github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= 39 | github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= 40 | github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= 41 | github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= 42 | github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= 43 | github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= 44 | github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= 45 | github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= 46 | github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= 47 | github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= 48 | github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= 49 | github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= 50 | github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 51 | github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= 52 | github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= 53 | github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 54 | github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= 55 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 56 | github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= 57 | github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= 58 | github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= 59 | github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= 60 | github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= 61 | github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= 62 | github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= 63 | github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= 64 | github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= 65 | github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= 66 | github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= 67 | github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= 68 | github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= 69 | github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= 70 | github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= 71 | github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= 72 | github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= 73 | github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= 74 | github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= 75 | github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= 76 | github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 77 | github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 78 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 79 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 80 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 81 | github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= 82 | github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 83 | github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= 84 | github.com/dubbogo/go-zookeeper v1.0.3/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c= 85 | github.com/dubbogo/gost v1.11.11 h1:u6kY0oJEZEKLCdo9Hz5eAqeDZev2e7+3rJrUkqgC24s= 86 | github.com/dubbogo/gost v1.11.11/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI= 87 | github.com/dubbogo/jsonparser v1.0.1/go.mod h1:tYAtpctvSP/tWw4MeelsowSPgXQRVHHWbqL6ynps8jU= 88 | github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 89 | github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 90 | github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= 91 | github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= 92 | github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= 93 | github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= 94 | github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= 95 | github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 96 | github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 97 | github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= 98 | github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= 99 | github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= 100 | github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= 101 | github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239/go.mod h1:Gdwt2ce0yfBxPvZrHkprdPPTTS3N5rwmLE8T22KBXlw= 102 | github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= 103 | github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= 104 | github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= 105 | github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= 106 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 107 | github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= 108 | github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= 109 | github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= 110 | github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= 111 | github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= 112 | github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= 113 | github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= 114 | github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= 115 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 116 | github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 117 | github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 118 | github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= 119 | github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= 120 | github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= 121 | github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= 122 | github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= 123 | github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= 124 | github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= 125 | github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= 126 | github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= 127 | github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= 128 | github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= 129 | github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= 130 | github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= 131 | github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= 132 | github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= 133 | github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= 134 | github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= 135 | github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM= 136 | github.com/go-xorm/xorm v0.7.9/go.mod h1:XiVxrMMIhFkwSkh96BW7PACl7UhLtx2iJIHMdmjh5sQ= 137 | github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= 138 | github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= 139 | github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= 140 | github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 141 | github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 142 | github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= 143 | github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= 144 | github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= 145 | github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= 146 | github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= 147 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 148 | github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 149 | github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 150 | github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 151 | github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 152 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 153 | github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 154 | github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= 155 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 156 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 157 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 158 | github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 159 | github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 160 | github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= 161 | github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= 162 | github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= 163 | github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= 164 | github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= 165 | github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= 166 | github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 167 | github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= 168 | github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 169 | github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 170 | github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 171 | github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 172 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 173 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 174 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 175 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 176 | github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= 177 | github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 178 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 179 | github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= 180 | github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 181 | github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 182 | github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 183 | github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 184 | github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 185 | github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= 186 | github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= 187 | github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= 188 | github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= 189 | github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= 190 | github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= 191 | github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= 192 | github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 193 | github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= 194 | github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= 195 | github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= 196 | github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= 197 | github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= 198 | github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= 199 | github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= 200 | github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= 201 | github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= 202 | github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= 203 | github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= 204 | github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 205 | github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= 206 | github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= 207 | github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 208 | github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= 209 | github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= 210 | github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= 211 | github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= 212 | github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 213 | github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 214 | github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= 215 | github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= 216 | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 217 | github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 218 | github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= 219 | github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= 220 | github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= 221 | github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= 222 | github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= 223 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 224 | github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= 225 | github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= 226 | github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= 227 | github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ= 228 | github.com/jackc/pgx v3.6.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= 229 | github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= 230 | github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= 231 | github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= 232 | github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= 233 | github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= 234 | github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 235 | github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 236 | github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 237 | github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 238 | github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 239 | github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= 240 | github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 241 | github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= 242 | github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 243 | github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= 244 | github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= 245 | github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= 246 | github.com/k0kubun/pp v3.0.1+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= 247 | github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= 248 | github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= 249 | github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= 250 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 251 | github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 252 | github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 253 | github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= 254 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 255 | github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= 256 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 257 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 258 | github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= 259 | github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 260 | github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= 261 | github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= 262 | github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570/go.mod h1:BLt8L9ld7wVsvEWQbuLrUZnCMnUmLZ+CGDzKtclrTlE= 263 | github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f/go.mod h1:UGmTpUd3rjbtfIpwAPrcfmGf/Z1HS95TATB+m57TPB8= 264 | github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042/go.mod h1:TPpsiPUEh0zFL1Snz4crhMlBe60PYxRHr5oFF3rRYg0= 265 | github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= 266 | github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= 267 | github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= 268 | github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= 269 | github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= 270 | github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= 271 | github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= 272 | github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= 273 | github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= 274 | github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= 275 | github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= 276 | github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= 277 | github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= 278 | github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 279 | github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= 280 | github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= 281 | github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 282 | github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 283 | github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= 284 | github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= 285 | github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= 286 | github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 287 | github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 288 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 289 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= 290 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 291 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 292 | github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= 293 | github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 294 | github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 295 | github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 296 | github.com/nacos-group/nacos-sdk-go v1.0.8/go.mod h1:hlAPn3UdzlxIlSILAyOXKxjFSvDJ9oLzTJ9hLAK1KzA= 297 | github.com/natefinch/lumberjack v2.0.0+incompatible h1:4QJd3OLAMgj7ph+yZTuX13Ld4UpgHp07nNdFX7mqFfM= 298 | github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk= 299 | github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= 300 | github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= 301 | github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= 302 | github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= 303 | github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= 304 | github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= 305 | github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= 306 | github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= 307 | github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= 308 | github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= 309 | github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= 310 | github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= 311 | github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= 312 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 313 | github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 314 | github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 315 | github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= 316 | github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= 317 | github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= 318 | github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= 319 | github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= 320 | github.com/opentrx/seata-golang/v2 v2.0.6-rc1 h1:IoMlDB9OeB91Fkc+JR5PU5QJlJieFvc3PbbRbnEj3Bs= 321 | github.com/opentrx/seata-golang/v2 v2.0.6-rc1/go.mod h1:gVGvCWHjTS+QVsq0A2iBLbQPW9PkTUheJ5Nnlyg6Dog= 322 | github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= 323 | github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= 324 | github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= 325 | github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= 326 | github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= 327 | github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= 328 | github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= 329 | github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= 330 | github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= 331 | github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= 332 | github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= 333 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 334 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 335 | github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= 336 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 337 | github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= 338 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 339 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 340 | github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= 341 | github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= 342 | github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= 343 | github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= 344 | github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= 345 | github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= 346 | github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= 347 | github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= 348 | github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= 349 | github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= 350 | github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= 351 | github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 352 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 353 | github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 354 | github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 355 | github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= 356 | github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= 357 | github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= 358 | github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= 359 | github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= 360 | github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= 361 | github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= 362 | github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= 363 | github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 364 | github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 365 | github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= 366 | github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= 367 | github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= 368 | github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= 369 | github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= 370 | github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= 371 | github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= 372 | github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= 373 | github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= 374 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 375 | github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 376 | github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= 377 | github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= 378 | github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= 379 | github.com/shirou/gopsutil v3.20.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= 380 | github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= 381 | github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= 382 | github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= 383 | github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= 384 | github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= 385 | github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= 386 | github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= 387 | github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= 388 | github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= 389 | github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= 390 | github.com/soheilhy/cmux v0.1.5-0.20210205191134-5ec6847320e5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= 391 | github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= 392 | github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 393 | github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= 394 | github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= 395 | github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= 396 | github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= 397 | github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= 398 | github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 399 | github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 400 | github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 401 | github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= 402 | github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= 403 | github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= 404 | github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= 405 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 406 | github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 407 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 408 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 409 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 410 | github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= 411 | github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= 412 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 413 | github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= 414 | github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ= 415 | github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= 416 | github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= 417 | github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= 418 | github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= 419 | github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3/go.mod h1:QDlpd3qS71vYtakd2hmdpqhJ9nwv6mD6A30bQ1BPBFE= 420 | github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= 421 | github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= 422 | github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= 423 | github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= 424 | github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= 425 | github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= 426 | github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= 427 | github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= 428 | github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 429 | github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 430 | github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= 431 | go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= 432 | go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= 433 | go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= 434 | go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= 435 | go.etcd.io/etcd/api/v3 v3.5.0-alpha.0/go.mod h1:mPcW6aZJukV6Aa81LSKpBjQXTWlXB5r74ymPoSWa3Sw= 436 | go.etcd.io/etcd/client/v2 v2.305.0-alpha.0/go.mod h1:kdV+xzCJ3luEBSIeQyB/OEKkWKd8Zkux4sbDeANrosU= 437 | go.etcd.io/etcd/client/v3 v3.5.0-alpha.0/go.mod h1:wKt7jgDgf/OfKiYmCq5WFGxOFAkVMLxiiXgLDFhECr8= 438 | go.etcd.io/etcd/pkg/v3 v3.5.0-alpha.0/go.mod h1:tV31atvwzcybuqejDoY3oaNRTtlD2l/Ot78Pc9w7DMY= 439 | go.etcd.io/etcd/raft/v3 v3.5.0-alpha.0/go.mod h1:FAwse6Zlm5v4tEWZaTjmNhe17Int4Oxbu7+2r0DiD3w= 440 | go.etcd.io/etcd/server/v3 v3.5.0-alpha.0/go.mod h1:tsKetYpt980ZTpzl/gb+UOJj9RkIyCb1u4wjzMg90BQ= 441 | go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= 442 | go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= 443 | go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= 444 | go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= 445 | go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 446 | go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= 447 | go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= 448 | go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= 449 | go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= 450 | go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= 451 | go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= 452 | go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= 453 | go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= 454 | go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= 455 | go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= 456 | go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= 457 | go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= 458 | go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= 459 | go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= 460 | go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= 461 | go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= 462 | go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= 463 | go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= 464 | golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 465 | golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 466 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 467 | golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 468 | golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 469 | golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 470 | golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 471 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 472 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 473 | golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 474 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 475 | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 476 | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= 477 | golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= 478 | golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= 479 | golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= 480 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= 481 | golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 482 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 483 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 484 | golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 485 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 486 | golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 487 | golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 488 | golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 489 | golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 490 | golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 491 | golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= 492 | golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= 493 | golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= 494 | golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 495 | golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 496 | golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 497 | golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 498 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 499 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 500 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 501 | golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 502 | golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 503 | golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 504 | golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 505 | golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 506 | golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 507 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 508 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 509 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 510 | golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 511 | golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 512 | golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 513 | golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 514 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 515 | golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 516 | golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 517 | golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 518 | golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 519 | golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 520 | golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 521 | golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 522 | golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 523 | golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0= 524 | golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= 525 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 526 | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 527 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 528 | golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 529 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 530 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 531 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 532 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 533 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 534 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 535 | golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 536 | golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 537 | golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 538 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 539 | golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 540 | golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 541 | golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 542 | golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 543 | golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 544 | golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 545 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 546 | golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 547 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 548 | golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 549 | golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 550 | golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 551 | golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 552 | golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 553 | golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 554 | golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 555 | golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 556 | golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 557 | golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 558 | golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 559 | golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 560 | golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 561 | golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 562 | golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 563 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 564 | golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 565 | golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 566 | golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 567 | golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 568 | golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 569 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 570 | golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 571 | golang.org/x/sys v0.0.0-20201223074533-0d417f636930/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 572 | golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 573 | golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= 574 | golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 575 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 576 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 577 | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 578 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 579 | golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= 580 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 581 | golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 582 | golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 583 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 584 | golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 585 | golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 586 | golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 587 | golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 588 | golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 589 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 590 | golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 591 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 592 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 593 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 594 | golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 595 | golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 596 | golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 597 | golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 598 | golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 599 | golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 600 | golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 601 | golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 602 | golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 603 | golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 604 | golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 605 | golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 606 | golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 607 | golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 608 | golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 609 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 610 | golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 611 | golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 612 | golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 613 | golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 614 | golang.org/x/tools v0.0.0-20201014170642-d1624618ad65/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= 615 | golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 616 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 617 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 618 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 619 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= 620 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 621 | google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= 622 | google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= 623 | google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= 624 | google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 625 | google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 626 | google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 627 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 628 | google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 629 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 630 | google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 631 | google.golang.org/appengine v1.6.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 632 | google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= 633 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 634 | google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 635 | google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 636 | google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 637 | google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 638 | google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 639 | google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= 640 | google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 641 | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 642 | google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= 643 | google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 644 | google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 645 | google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 646 | google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= 647 | google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98 h1:LCO0fg4kb6WwkXQXRQQgUYsFeFb5taTX5WAx5O/Vt28= 648 | google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 649 | google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= 650 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 651 | google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= 652 | google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= 653 | google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 654 | google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 655 | google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 656 | google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 657 | google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 658 | google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= 659 | google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 660 | google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 661 | google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= 662 | google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= 663 | google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= 664 | google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= 665 | google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= 666 | google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= 667 | google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= 668 | google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= 669 | google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= 670 | google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= 671 | google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 672 | google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 673 | google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 674 | google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 675 | google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= 676 | google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 677 | gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 678 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 679 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 680 | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 681 | gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= 682 | gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 683 | gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= 684 | gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= 685 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 686 | gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= 687 | gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= 688 | gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= 689 | gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= 690 | gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= 691 | gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= 692 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 693 | gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= 694 | gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= 695 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 696 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 697 | gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 698 | gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 699 | gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 700 | gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 701 | gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 702 | gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 703 | gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 704 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 705 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= 706 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 707 | honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 708 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 709 | honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 710 | honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 711 | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 712 | honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= 713 | rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= 714 | sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= 715 | sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= 716 | sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= 717 | xorm.io/builder v0.3.6/go.mod h1:LEFAPISnRzG+zxaxj2vPicRwz67BdhFreKg8yv8/TgU= 718 | xorm.io/builder v0.3.9/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE= 719 | xorm.io/core v0.7.2-0.20190928055935-90aeac8d08eb/go.mod h1:jJfd0UAEzZ4t87nbQYtVjmqpIODugN6PD2D9E+dJvdM= 720 | -------------------------------------------------------------------------------- /tcc-remote/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/gin-gonic/gin" 7 | "github.com/opentrx/seata-golang/v2/pkg/client" 8 | "github.com/opentrx/seata-golang/v2/pkg/client/config" 9 | "github.com/opentrx/seata-golang/v2/pkg/client/tcc" 10 | "github.com/opentrx/seata-golang/v2/pkg/client/tm" 11 | 12 | "github.com/opentrx/seata-go-samples/service" 13 | ) 14 | 15 | func main() { 16 | r := gin.Default() 17 | 18 | configPath := os.Getenv("ConfigPath") 19 | config := config.InitConfiguration(configPath) 20 | client.Init(config) 21 | 22 | tm.Implement(service.ProxySvc) 23 | tcc.ImplementTCC(service.TccProxyServiceA) 24 | 25 | r.GET("/commit", func(c *gin.Context) { 26 | service.ProxySvc.TCCCommitted(c) 27 | c.JSON(200, gin.H{ 28 | "message": "pong", 29 | }) 30 | }) 31 | 32 | r.GET("/rollback", func(c *gin.Context) { 33 | service.ProxySvc.TCCCanceled(c) 34 | c.JSON(200, gin.H{ 35 | "message": "pong", 36 | }) 37 | }) 38 | r.Run(":8081") 39 | } 40 | -------------------------------------------------------------------------------- /tcc-remote/main2.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/gin-gonic/gin" 7 | "github.com/opentrx/seata-golang/v2/pkg/client" 8 | ctx "github.com/opentrx/seata-golang/v2/pkg/client/base/context" 9 | "github.com/opentrx/seata-golang/v2/pkg/client/config" 10 | "github.com/opentrx/seata-golang/v2/pkg/client/tcc" 11 | 12 | "github.com/opentrx/seata-go-samples/service" 13 | ) 14 | 15 | func main() { 16 | r := gin.Default() 17 | 18 | configPath := os.Getenv("ConfigPath") 19 | config := config.InitConfiguration(configPath) 20 | client.Init(config) 21 | 22 | tcc.ImplementTCC(service.TccProxyServiceB) 23 | 24 | r.GET("/try", func(c *gin.Context) { 25 | rootContext := ctx.NewRootContext(c) 26 | rootContext.Bind(c.GetHeader("xid")) 27 | 28 | businessActionContextB := &ctx.BusinessActionContext{ 29 | RootContext: rootContext, 30 | ActionContext: make(map[string]interface{}), 31 | } 32 | businessActionContextB.ActionContext["hello"] = "hello world,this is from BusinessActionContext B" 33 | 34 | service.TccProxyServiceB.Try(businessActionContextB, false) 35 | 36 | c.JSON(200, gin.H{ 37 | "message": "pong", 38 | }) 39 | }) 40 | r.Run(":8082") 41 | } 42 | -------------------------------------------------------------------------------- /tcc-remote/service/service.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "context" 5 | "errors" 6 | "fmt" 7 | "net/http" 8 | 9 | ctx "github.com/opentrx/seata-golang/v2/pkg/client/base/context" 10 | "github.com/opentrx/seata-golang/v2/pkg/client/base/model" 11 | ) 12 | 13 | type Service struct { 14 | } 15 | 16 | func (svc *Service) TCCCommitted(context context.Context) error { 17 | rootContext := context.(*ctx.RootContext) 18 | businessActionContextA := &ctx.BusinessActionContext{ 19 | RootContext: rootContext, 20 | ActionContext: make(map[string]interface{}), 21 | } 22 | // 业务参数全部放到 ActionContext 里 23 | businessActionContextA.ActionContext["hello"] = "hello world,this is from BusinessActionContext A" 24 | 25 | resultA, err := TccProxyServiceA.Try(businessActionContextA, false) 26 | fmt.Printf("result A is :%v", resultA) 27 | if err != nil { 28 | return err 29 | } 30 | 31 | req2, err := http.NewRequest("GET", "http://localhost:8082/try", nil) 32 | if err != nil { 33 | return err 34 | } 35 | req2.Header.Set("Content-Type", "application/json") 36 | req2.Header.Set("xid", rootContext.GetXID()) 37 | 38 | client := &http.Client{} 39 | resultB, err2 := client.Do(req2) 40 | if err2 != nil { 41 | return err2 42 | } 43 | fmt.Printf("result B is :%v", resultB) 44 | 45 | return nil 46 | } 47 | 48 | func (svc *Service) TCCCanceled(context context.Context) error { 49 | rootContext := context.(*ctx.RootContext) 50 | businessActionContextA := &ctx.BusinessActionContext{ 51 | RootContext: rootContext, 52 | ActionContext: make(map[string]interface{}), 53 | } 54 | businessActionContextA.ActionContext["hello"] = "hello world,this is from BusinessActionContext A" 55 | 56 | resultA, err := TccProxyServiceA.Try(businessActionContextA, false) 57 | fmt.Printf("result A is :%v", resultA) 58 | if err != nil { 59 | return err 60 | } 61 | 62 | req2, err := http.NewRequest("GET", "http://localhost:8082/try", nil) 63 | if err != nil { 64 | return err 65 | } 66 | req2.Header.Set("Content-Type", "application/json") 67 | req2.Header.Set("xid", rootContext.GetXID()) 68 | 69 | client := &http.Client{} 70 | resultB, err2 := client.Do(req2) 71 | if err2 != nil { 72 | return err2 73 | } 74 | fmt.Printf("result B is :%v", resultB) 75 | 76 | return errors.New("should cancel") 77 | } 78 | 79 | var service = &Service{} 80 | 81 | type ProxyService struct { 82 | *Service 83 | TCCCommitted func(ctx context.Context) error 84 | TCCCanceled func(ctx context.Context) error 85 | } 86 | 87 | func (svc *ProxyService) GetProxyService() interface{} { 88 | return svc.Service 89 | } 90 | 91 | func (svc *ProxyService) GetMethodTransactionInfo(methodName string) *model.TransactionInfo { 92 | return methodTransactionInfo[methodName] 93 | } 94 | 95 | var methodTransactionInfo = make(map[string]*model.TransactionInfo) 96 | 97 | func init() { 98 | methodTransactionInfo["TCCCommitted"] = &model.TransactionInfo{ 99 | TimeOut: 60000000, 100 | Name: "TCC_TEST_COMMITTED", 101 | Propagation: model.Required, 102 | } 103 | methodTransactionInfo["TCCCanceled"] = &model.TransactionInfo{ 104 | TimeOut: 60000000, 105 | Name: "TCC_TEST_CANCELED", 106 | Propagation: model.Required, 107 | } 108 | } 109 | 110 | var ProxySvc = &ProxyService{ 111 | Service: service, 112 | } 113 | -------------------------------------------------------------------------------- /tcc-remote/service/service_a.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/opentrx/seata-golang/v2/pkg/client/base/context" 7 | "github.com/opentrx/seata-golang/v2/pkg/client/tcc" 8 | ) 9 | 10 | type ServiceA struct { 11 | } 12 | 13 | func (svc *ServiceA) Try(ctx *context.BusinessActionContext, async bool) (bool, error) { 14 | word := ctx.ActionContext["hello"] 15 | fmt.Println(word) 16 | fmt.Println("Service A Tried!") 17 | return true, nil 18 | } 19 | 20 | func (svc *ServiceA) Confirm(ctx *context.BusinessActionContext) bool { 21 | word := ctx.ActionContext["hello"] 22 | fmt.Println(word) 23 | fmt.Println("Service A confirmed!") 24 | return true 25 | } 26 | 27 | func (svc *ServiceA) Cancel(ctx *context.BusinessActionContext) bool { 28 | word := ctx.ActionContext["hello"] 29 | fmt.Println(word) 30 | fmt.Println("Service A canceled!") 31 | return true 32 | } 33 | 34 | var serviceA = &ServiceA{} 35 | 36 | type TCCProxyServiceA struct { 37 | *ServiceA 38 | 39 | Try func(ctx *context.BusinessActionContext, async bool) (bool, error) `TccActionName:"ServiceA"` 40 | } 41 | 42 | func (svc *TCCProxyServiceA) GetTccService() tcc.TccService { 43 | return svc.ServiceA 44 | } 45 | 46 | var TccProxyServiceA = &TCCProxyServiceA{ 47 | ServiceA: serviceA, 48 | } 49 | -------------------------------------------------------------------------------- /tcc-remote/service/service_b.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/opentrx/seata-golang/v2/pkg/client/base/context" 7 | "github.com/opentrx/seata-golang/v2/pkg/client/tcc" 8 | ) 9 | 10 | type ServiceB struct { 11 | } 12 | 13 | func (svc *ServiceB) Try(ctx *context.BusinessActionContext, async bool) (bool, error) { 14 | word := ctx.ActionContext["hello"] 15 | fmt.Println(word) 16 | fmt.Println("Service B Tried!") 17 | return true, nil 18 | } 19 | 20 | func (svc *ServiceB) Confirm(ctx *context.BusinessActionContext) bool { 21 | word := ctx.ActionContext["hello"] 22 | fmt.Println(word) 23 | fmt.Println("Service B confirmed!") 24 | return true 25 | } 26 | 27 | func (svc *ServiceB) Cancel(ctx *context.BusinessActionContext) bool { 28 | word := ctx.ActionContext["hello"] 29 | fmt.Println(word) 30 | fmt.Println("Service B canceled!") 31 | return true 32 | } 33 | 34 | var serviceB = &ServiceB{} 35 | 36 | type TCCProxyServiceB struct { 37 | *ServiceB 38 | 39 | Try func(ctx *context.BusinessActionContext, async bool) (bool, error) `TccActionName:"ServiceB"` 40 | } 41 | 42 | func (svc *TCCProxyServiceB) GetTccService() tcc.TccService { 43 | return svc.ServiceB 44 | } 45 | 46 | var TccProxyServiceB = &TCCProxyServiceB{ 47 | ServiceB: serviceB, 48 | } 49 | -------------------------------------------------------------------------------- /tcc/conf/config.yml: -------------------------------------------------------------------------------- 1 | port: 8081 2 | addressing: localhost:8081 3 | serverAddressing: localhost:8091 4 | tm: 5 | commitRetryCount: 5 6 | rollbackRetryCount: 5 7 | enforcementPolicy: 8 | minTime: 5m 9 | permitWithoutStream: true 10 | serverParameters: 11 | maxConnectionIdle: 15s 12 | maxConnectionAge: 30s 13 | maxConnectionAgeGrace: 5s 14 | time: 5s 15 | timeout: 2s 16 | clientTLS: 17 | enable: false 18 | certFilePath: "" 19 | serverName: "test.seata.io" 20 | clientParameters: 21 | time: 10s 22 | timeout: 2s 23 | permitWithoutStream: true 24 | -------------------------------------------------------------------------------- /tcc/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/opentrx/seata-go-samples 2 | 3 | go 1.15 4 | 5 | require ( 6 | github.com/gin-gonic/gin v1.6.3 7 | github.com/opentrx/seata-golang/v2 v2.0.7-rc3 8 | ) 9 | -------------------------------------------------------------------------------- /tcc/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/gin-gonic/gin" 7 | "github.com/opentrx/seata-golang/v2/pkg/client" 8 | "github.com/opentrx/seata-golang/v2/pkg/client/config" 9 | "github.com/opentrx/seata-golang/v2/pkg/client/tcc" 10 | "github.com/opentrx/seata-golang/v2/pkg/client/tm" 11 | 12 | "github.com/opentrx/seata-go-samples/service" 13 | ) 14 | 15 | func main() { 16 | r := gin.Default() 17 | 18 | configPath := os.Getenv("ConfigPath") 19 | config := config.InitConfiguration(configPath) 20 | client.Init(config) 21 | 22 | tm.Implement(service.ProxySvc) 23 | tcc.ImplementTCC(service.TccProxyServiceA) 24 | tcc.ImplementTCC(service.TccProxyServiceB) 25 | tcc.ImplementTCC(service.TccProxyServiceC) 26 | 27 | r.GET("/commit", func(c *gin.Context) { 28 | service.ProxySvc.TCCCommitted(c) 29 | c.JSON(200, gin.H{ 30 | "message": "pong", 31 | }) 32 | }) 33 | r.GET("/rollback", func(c *gin.Context) { 34 | service.ProxySvc.TCCCanceled(c) 35 | c.JSON(200, gin.H{ 36 | "message": "pong", 37 | }) 38 | }) 39 | r.Run() 40 | } 41 | -------------------------------------------------------------------------------- /tcc/service/service.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | ctx "github.com/opentrx/seata-golang/v2/pkg/client/base/context" 8 | "github.com/opentrx/seata-golang/v2/pkg/client/base/model" 9 | ) 10 | 11 | type Service struct { 12 | } 13 | 14 | func (svc *Service) TCCCommitted(context context.Context) error { 15 | rootContext := context.(*ctx.RootContext) 16 | businessActionContextA := &ctx.BusinessActionContext{ 17 | RootContext: rootContext, 18 | ActionContext: make(map[string]interface{}), 19 | } 20 | // 业务参数全部放到 ActionContext 里 21 | businessActionContextA.ActionContext["hello"] = "hello world,this is from BusinessActionContext A" 22 | 23 | businessActionContextB := &ctx.BusinessActionContext{ 24 | RootContext: rootContext, 25 | ActionContext: make(map[string]interface{}), 26 | } 27 | businessActionContextB.ActionContext["hello"] = "hello world,this is from BusinessActionContext B" 28 | 29 | resultA, err := TccProxyServiceA.Try(businessActionContextA, false) 30 | fmt.Printf("result A is :%v", resultA) 31 | if err != nil { 32 | return err 33 | } 34 | 35 | resultB, err := TccProxyServiceB.Try(businessActionContextB, false) 36 | fmt.Printf("result B is :%v", resultB) 37 | if err != nil { 38 | return err 39 | } 40 | 41 | return nil 42 | } 43 | 44 | func (svc *Service) TCCCanceled(context context.Context) error { 45 | rootContext := context.(*ctx.RootContext) 46 | businessActionContextA := &ctx.BusinessActionContext{ 47 | RootContext: rootContext, 48 | ActionContext: make(map[string]interface{}), 49 | } 50 | businessActionContextA.ActionContext["hello"] = "hello world,this is from BusinessActionContext A" 51 | 52 | businessActionContextC := &ctx.BusinessActionContext{ 53 | RootContext: rootContext, 54 | ActionContext: make(map[string]interface{}), 55 | } 56 | businessActionContextC.ActionContext["hello"] = "hello world,this is from BusinessActionContext C" 57 | 58 | resultA, err := TccProxyServiceA.Try(businessActionContextA, false) 59 | fmt.Printf("result A is :%v", resultA) 60 | if err != nil { 61 | return err 62 | } 63 | 64 | resultC, err := TccProxyServiceC.Try(businessActionContextC, false) 65 | fmt.Printf("result C is :%v", resultC) 66 | if err != nil { 67 | return err 68 | } 69 | 70 | return nil 71 | } 72 | 73 | var service = &Service{} 74 | 75 | type ProxyService struct { 76 | *Service 77 | TCCCommitted func(ctx context.Context) error 78 | TCCCanceled func(ctx context.Context) error 79 | } 80 | 81 | func (svc *ProxyService) GetProxyService() interface{} { 82 | return svc.Service 83 | } 84 | 85 | func (svc *ProxyService) GetMethodTransactionInfo(methodName string) *model.TransactionInfo { 86 | return methodTransactionInfo[methodName] 87 | } 88 | 89 | var methodTransactionInfo = make(map[string]*model.TransactionInfo) 90 | 91 | func init() { 92 | methodTransactionInfo["TCCCommitted"] = &model.TransactionInfo{ 93 | TimeOut: 60000000, 94 | Name: "TCC_TEST_COMMITTED", 95 | Propagation: model.Required, 96 | } 97 | methodTransactionInfo["TCCCanceled"] = &model.TransactionInfo{ 98 | TimeOut: 60000000, 99 | Name: "TCC_TEST_CANCELED", 100 | Propagation: model.Required, 101 | } 102 | } 103 | 104 | var ProxySvc = &ProxyService{ 105 | Service: service, 106 | } 107 | -------------------------------------------------------------------------------- /tcc/service/service_a.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/opentrx/seata-golang/v2/pkg/client/base/context" 7 | "github.com/opentrx/seata-golang/v2/pkg/client/tcc" 8 | ) 9 | 10 | type ServiceA struct { 11 | } 12 | 13 | func (svc *ServiceA) Try(ctx *context.BusinessActionContext, async bool) (bool, error) { 14 | word := ctx.ActionContext["hello"] 15 | fmt.Println(word) 16 | fmt.Println("Service A Tried!") 17 | return true, nil 18 | } 19 | 20 | func (svc *ServiceA) Confirm(ctx *context.BusinessActionContext) bool { 21 | word := ctx.ActionContext["hello"] 22 | fmt.Println(word) 23 | fmt.Println("Service A confirmed!") 24 | return true 25 | } 26 | 27 | func (svc *ServiceA) Cancel(ctx *context.BusinessActionContext) bool { 28 | word := ctx.ActionContext["hello"] 29 | fmt.Println(word) 30 | fmt.Println("Service A canceled!") 31 | return true 32 | } 33 | 34 | var serviceA = &ServiceA{} 35 | 36 | type TCCProxyServiceA struct { 37 | *ServiceA 38 | 39 | Try func(ctx *context.BusinessActionContext, async bool) (bool, error) `TccActionName:"ServiceA"` 40 | } 41 | 42 | func (svc *TCCProxyServiceA) GetTccService() tcc.TccService { 43 | return svc.ServiceA 44 | } 45 | 46 | var TccProxyServiceA = &TCCProxyServiceA{ 47 | ServiceA: serviceA, 48 | } 49 | -------------------------------------------------------------------------------- /tcc/service/service_b.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/opentrx/seata-golang/v2/pkg/client/base/context" 7 | "github.com/opentrx/seata-golang/v2/pkg/client/tcc" 8 | ) 9 | 10 | type ServiceB struct { 11 | } 12 | 13 | func (svc *ServiceB) Try(ctx *context.BusinessActionContext, async bool) (bool, error) { 14 | word := ctx.ActionContext["hello"] 15 | fmt.Println(word) 16 | fmt.Println("Service B Tried!") 17 | return true, nil 18 | } 19 | 20 | func (svc *ServiceB) Confirm(ctx *context.BusinessActionContext) bool { 21 | word := ctx.ActionContext["hello"] 22 | fmt.Println(word) 23 | fmt.Println("Service B confirmed!") 24 | return true 25 | } 26 | 27 | func (svc *ServiceB) Cancel(ctx *context.BusinessActionContext) bool { 28 | word := ctx.ActionContext["hello"] 29 | fmt.Println(word) 30 | fmt.Println("Service B canceled!") 31 | return true 32 | } 33 | 34 | var serviceB = &ServiceB{} 35 | 36 | type TCCProxyServiceB struct { 37 | *ServiceB 38 | 39 | Try func(ctx *context.BusinessActionContext, async bool) (bool, error) `TccActionName:"ServiceB"` 40 | } 41 | 42 | func (svc *TCCProxyServiceB) GetTccService() tcc.TccService { 43 | return svc.ServiceB 44 | } 45 | 46 | var TccProxyServiceB = &TCCProxyServiceB{ 47 | ServiceB: serviceB, 48 | } 49 | -------------------------------------------------------------------------------- /tcc/service/service_c.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | 7 | "github.com/opentrx/seata-golang/v2/pkg/client/base/context" 8 | "github.com/opentrx/seata-golang/v2/pkg/client/tcc" 9 | ) 10 | 11 | type ServiceC struct { 12 | } 13 | 14 | func (svc *ServiceC) Try(ctx *context.BusinessActionContext, async bool) (bool, error) { 15 | word := ctx.ActionContext["hello"] 16 | fmt.Println(word) 17 | fmt.Println("Service C Tried!") 18 | return true, errors.New("there is a error") 19 | } 20 | 21 | func (svc *ServiceC) Confirm(ctx *context.BusinessActionContext) bool { 22 | word := ctx.ActionContext["hello"] 23 | fmt.Println(word) 24 | fmt.Println("Service C confirmed!") 25 | return true 26 | } 27 | 28 | func (svc *ServiceC) Cancel(ctx *context.BusinessActionContext) bool { 29 | word := ctx.ActionContext["hello"] 30 | fmt.Println(word) 31 | fmt.Println("Service C canceled!") 32 | return true 33 | } 34 | 35 | var serviceC = &ServiceC{} 36 | 37 | type TCCProxyServiceC struct { 38 | *ServiceC 39 | 40 | Try func(ctx *context.BusinessActionContext, async bool) (bool, error) `TccActionName:"ServiceC"` 41 | } 42 | 43 | func (svc *TCCProxyServiceC) GetTccService() tcc.TccService { 44 | return svc.ServiceC 45 | } 46 | 47 | var TccProxyServiceC = &TCCProxyServiceC{ 48 | ServiceC: serviceC, 49 | } 50 | --------------------------------------------------------------------------------