(raw string)
| 2565 | } |
| 2566 | |
| 2567 | func parseMemoryLimit(raw string) (int, error) { |
| 2568 | trimmed := strings.TrimSpace(raw) |
| 2569 | if trimmed == "" { |
| 2570 | return 0, nil |
| 2571 | } |
| 2572 | limit, err := strconv.Atoi(trimmed) |
| 2573 | if err != nil || limit <= 0 { |
| 2574 | return 0, NewMemoryValidationError(errors.New("limit must be a positive integer")) |
| 2575 | } |
| 2576 | return limit, nil |
| 2577 | } |
| 2578 | |
| 2579 | func parseMemoryHistoryQuery(c *gin.Context) (memcontract.OperationHistoryQuery, error) { |
| 2580 | scope, workspace, err := resolveMemoryScopeAndWorkspace( |
no test coverage detected