(ctx context.Context)
| 146 | } |
| 147 | |
| 148 | func GetConf(ctx context.Context) *ClientConfig { |
| 149 | v := ctx.Value(ConfigCtxKey) |
| 150 | if v != nil { |
| 151 | return (v.(*ClientConfig)) |
| 152 | } |
| 153 | panic(fmt.Errorf("failed to find config in ctx")) |
| 154 | } |
| 155 | |
| 156 | func GetDb(ctx context.Context) *gorm.DB { |
| 157 | v := ctx.Value(DbCtxKey) |