NewStorageWithPolicy 根据策略获取存储对象
(policy *serverconfigs.HTTPCachePolicy)
| 177 | |
| 178 | // NewStorageWithPolicy 根据策略获取存储对象 |
| 179 | func (this *Manager) NewStorageWithPolicy(policy *serverconfigs.HTTPCachePolicy) StorageInterface { |
| 180 | switch policy.Type { |
| 181 | case serverconfigs.CachePolicyStorageFile: |
| 182 | return NewFileStorage(policy) |
| 183 | case serverconfigs.CachePolicyStorageMemory: |
| 184 | return NewMemoryStorage(policy, nil) |
| 185 | } |
| 186 | return nil |
| 187 | } |
| 188 | |
| 189 | // StorageMap 获取已有的存储对象 |
| 190 | func (this *Manager) StorageMap() map[int64]StorageInterface { |
no test coverage detected