(configPath string)
| 83 | } |
| 84 | |
| 85 | func readOpenclawConfig(configPath string) (map[string]interface{}, error) { |
| 86 | if strings.TrimSpace(configPath) == "" { |
| 87 | return nil, buserr.New("ErrRecordNotFound") |
| 88 | } |
| 89 | fileOp := files.NewFileOp() |
| 90 | content, err := fileOp.GetContent(configPath) |
| 91 | if err != nil { |
| 92 | return nil, err |
| 93 | } |
| 94 | conf := map[string]interface{}{} |
| 95 | if err := json.Unmarshal(content, &conf); err != nil { |
| 96 | return nil, err |
| 97 | } |
| 98 | return conf, nil |
| 99 | } |
| 100 | |
| 101 | func writeOpenclawConfigRaw(configPath string, conf map[string]interface{}) error { |
| 102 | ensureGatewaySecurityDefaults(conf) |
no test coverage detected