ensureCollectionDir 确保 collection 目录存在
(collection string)
| 364 | |
| 365 | // ensureCollectionDir 确保 collection 目录存在 |
| 366 | func (js *JSONStore) ensureCollectionDir(collection string) error { |
| 367 | dir := js.collectionDir(collection) |
| 368 | return os.MkdirAll(dir, 0755) |
| 369 | } |
| 370 | |
| 371 | // Get 获取单个资源 |
| 372 | func (js *JSONStore) Get(ctx context.Context, collection, key string, dest any) error { |