Add 添加内容
(hash string, item *Item)
| 65 | |
| 66 | // Add 添加内容 |
| 67 | func (this *KVFileList) Add(hash string, item *Item) error { |
| 68 | err := this.getStore(hash).AddItem(hash, item) |
| 69 | if err != nil { |
| 70 | return err |
| 71 | } |
| 72 | |
| 73 | if this.onAdd != nil { |
| 74 | this.onAdd(item) |
| 75 | } |
| 76 | |
| 77 | return nil |
| 78 | } |
| 79 | |
| 80 | // Exist 检查内容是否存在 |
| 81 | func (this *KVFileList) Exist(hash string) (bool, int64, error) { |