MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / updateIntField

Method updateIntField

internal/api/handlers/management/handler.go:437–447  ·  view source on GitHub ↗
(c *gin.Context, set func(int))

Source from the content-addressed store, hash-verified

435}
436
437func (h *Handler) updateIntField(c *gin.Context, set func(int)) {
438 var body struct {
439 Value *int `json:"value"`
440 }
441 if err := c.ShouldBindJSON(&body); err != nil || body.Value == nil {
442 c.JSON(http.StatusBadRequest, gin.H{"error": "invalid body"})
443 return
444 }
445 set(*body.Value)
446 h.persist(c)
447}
448
449func (h *Handler) updateStringField(c *gin.Context, set func(string)) {
450 var body struct {

Callers 2

PutRequestRetryMethod · 0.95
PutMaxRetryIntervalMethod · 0.95

Calls 1

persistMethod · 0.95

Tested by

no test coverage detected