(c *gin.Context)
| 15 | ) |
| 16 | |
| 17 | func GetOptions(c *gin.Context) { |
| 18 | var options []*model.Option |
| 19 | common.OptionMapRWMutex.Lock() |
| 20 | for k, v := range common.OptionMap { |
| 21 | if strings.HasSuffix(k, "Token") || strings.HasSuffix(k, "Secret") || strings.HasSuffix(k, "Key") { |
| 22 | continue |
| 23 | } |
| 24 | options = append(options, &model.Option{ |
| 25 | Key: k, |
| 26 | Value: common.Interface2String(v), |
| 27 | }) |
| 28 | } |
| 29 | common.OptionMapRWMutex.Unlock() |
| 30 | c.JSON(http.StatusOK, gin.H{ |
| 31 | "success": true, |
| 32 | "message": "", |
| 33 | "data": options, |
| 34 | }) |
| 35 | return |
| 36 | } |
| 37 | |
| 38 | func UpdateOption(c *gin.Context) { |
| 39 | var option model.Option |
nothing calls this directly
no test coverage detected