AddForTest used to add table config for test.
(db string, confs ...*config.TableConfig)
| 497 | |
| 498 | // AddForTest used to add table config for test. |
| 499 | func (r *Router) AddForTest(db string, confs ...*config.TableConfig) error { |
| 500 | r.mu.Lock() |
| 501 | defer r.mu.Unlock() |
| 502 | |
| 503 | log := r.log |
| 504 | // add config to router. |
| 505 | for _, conf := range confs { |
| 506 | if err := r.addTable(db, conf); err != nil { |
| 507 | log.Error("frm.for.test.addroute.error:%v", err) |
| 508 | return err |
| 509 | } |
| 510 | } |
| 511 | return nil |
| 512 | } |