MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / NewStorageWithPolicy

Method NewStorageWithPolicy

internal/caches/manager.go:179–187  ·  view source on GitHub ↗

NewStorageWithPolicy 根据策略获取存储对象

(policy *serverconfigs.HTTPCachePolicy)

Source from the content-addressed store, hash-verified

177
178// NewStorageWithPolicy 根据策略获取存储对象
179func (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 获取已有的存储对象
190func (this *Manager) StorageMap() map[int64]StorageInterface {

Callers 2

UpdatePoliciesMethod · 0.95
cacheStorageMethod · 0.80

Calls 2

NewFileStorageFunction · 0.85
NewMemoryStorageFunction · 0.85

Tested by

no test coverage detected