2020-07-10 21:33:43 +00:00
|
|
|
package handler
|
|
|
|
|
|
|
|
type AssetType int
|
|
|
|
|
|
|
|
const (
|
|
|
|
Segment AssetType = 0
|
|
|
|
MediaPlaylist
|
|
|
|
MasterPlaylist
|
|
|
|
)
|
|
|
|
|
|
|
|
type Asset struct {
|
2020-07-13 12:24:28 +00:00
|
|
|
Path string
|
|
|
|
Key string // should this be passed with the asset? or decided upon by the handler?
|
2020-07-10 21:33:43 +00:00
|
|
|
Type AssetType
|
|
|
|
ContentType string
|
|
|
|
}
|
|
|
|
|
|
|
|
type Handler interface {
|
|
|
|
AssetAdded(a Asset) error
|
2020-07-13 12:24:28 +00:00
|
|
|
|
|
|
|
// TODO it is probably better to remove this because it will be difficult to ensure
|
|
|
|
// that all old assets are always cleaned up (it would be easy for this callback to be missed,
|
|
|
|
// for example). Better for implementations to be responsible for cleaning up old files, either
|
|
|
|
// using an implementation-specific method (e.g. S3 expiring objects) or just a periodic check.
|
2020-07-10 21:33:43 +00:00
|
|
|
AssetRemoved(a Asset) error
|
|
|
|
}
|