OpenWriter 打开缓存写入器等待写入
(key string, expiredAt int64, status int, headerSize int, bodySize int64, maxSize int64, isPartial bool)
| 168 | |
| 169 | // OpenWriter 打开缓存写入器等待写入 |
| 170 | func (this *MemoryStorage) OpenWriter(key string, expiredAt int64, status int, headerSize int, bodySize int64, maxSize int64, isPartial bool) (Writer, error) { |
| 171 | if maxSize > 0 && this.ignoreKeys.Has(types.String(maxSize)+"$"+key) { |
| 172 | return nil, ErrEntityTooLarge |
| 173 | } |
| 174 | |
| 175 | // TODO 内存缓存暂时不支持分块内容存储 |
| 176 | if isPartial { |
| 177 | return nil, fmt.Errorf("%w (004)", ErrFileIsWriting) |
| 178 | } |
| 179 | return this.openWriter(key, expiredAt, status, headerSize, bodySize, maxSize, true) |
| 180 | } |
| 181 | |
| 182 | // OpenFlushWriter 打开从其他媒介直接刷入的写入器 |
| 183 | func (this *MemoryStorage) OpenFlushWriter(key string, expiresAt int64, status int, headerSize int, bodySize int64) (Writer, error) { |