segmento/pkg/handler/handler.go

27 lines
740 B
Go

package handler
type AssetType int
const (
Segment AssetType = 0
MediaPlaylist
MasterPlaylist
)
type Asset struct {
Path string
Key string // should this be passed with the asset? or decided upon by the handler?
Type AssetType
ContentType string
}
type Handler interface {
AssetAdded(a Asset) error
// 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.
AssetRemoved(a Asset) error
}