NewJSONStore 创建JSON存储
(baseDir string)
| 38 | |
| 39 | // NewJSONStore 创建JSON存储 |
| 40 | func NewJSONStore(baseDir string) (*JSONStore, error) { |
| 41 | // 确保目录存在 |
| 42 | if err := os.MkdirAll(baseDir, 0755); err != nil { |
| 43 | return nil, fmt.Errorf("create base directory: %w", err) |
| 44 | } |
| 45 | |
| 46 | return &JSONStore{ |
| 47 | baseDir: baseDir, |
| 48 | }, nil |
| 49 | } |
| 50 | |
| 51 | // agentDir 获取Agent的存储目录 |
| 52 | func (js *JSONStore) agentDir(agentID string) string { |
no outgoing calls