Documentation ¶
Index ¶
- Constants
- func Fuzz(data []byte) int
- func NewManager(cfg *config.Config, cacheStore *store.Store, progressManager mgr.ProgressMgr, ...) (mgr.CDNMgr, error)
- type Manager
- func (cm *Manager) CheckFile(ctx context.Context, taskID string) bool
- func (cm *Manager) Delete(ctx context.Context, taskID string, force bool) error
- func (cm *Manager) GetGCTaskIDs(ctx context.Context, taskMgr mgr.TaskMgr) ([]string, error)
- func (cm *Manager) GetHTTPPath(ctx context.Context, taskInfo *types.TaskInfo) (string, error)
- func (cm *Manager) GetPieceMD5(ctx context.Context, taskID string, pieceNum int, pieceRange, source string) (pieceMd5 string, err error)
- func (cm *Manager) GetStatus(ctx context.Context, taskID string) (cdnStatus string, err error)
- func (cm *Manager) TriggerCDN(ctx context.Context, task *types.TaskInfo) (*types.TaskInfo, error)
Constants ¶
const ( PieceMd5SourceDefault = "default" PieceMd5SourceMemory = "memory" PieceMd5SourceMeta = "meta" PieceMd5SourceFile = "file" )
Variables ¶
This section is empty.
Functions ¶
func NewManager ¶
func NewManager(cfg *config.Config, cacheStore *store.Store, progressManager mgr.ProgressMgr, originClient httpclient.OriginHTTPClient, register prometheus.Registerer) (mgr.CDNMgr, error)
NewManager returns a new Manager.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is an implementation of the interface of CDNMgr.
func (*Manager) Delete ¶
Delete the cdn meta with specified taskID. It will also delete the files on the disk when the force equals true.
func (*Manager) GetGCTaskIDs ¶ added in v1.0.0
GetGCTaskIDs returns the taskIDs that should exec GC operations as a string slice.
It should return nil when the free disk of cdn storage is lager than config.YoungGCThreshold. It should return all taskIDs that are not running when the free disk of cdn storage is less than config.FullGCThreshold.
func (*Manager) GetHTTPPath ¶
GetHTTPPath returns the http download path of taskID. The returned path joined the DownloadRaw.Bucket and DownloadRaw.Key.
func (*Manager) GetPieceMD5 ¶ added in v1.0.0
func (cm *Manager) GetPieceMD5(ctx context.Context, taskID string, pieceNum int, pieceRange, source string) (pieceMd5 string, err error)
GetPieceMD5 gets the piece Md5 accorrding to the specified taskID and pieceNum.