2021-07-24 13:55:42 +00:00
|
|
|
package core
|
|
|
|
|
2022-05-03 12:38:45 +00:00
|
|
|
// source is an entity that can provide a stream.
|
|
|
|
// it can be:
|
|
|
|
// - a publisher
|
|
|
|
// - a static source
|
|
|
|
// - a redirect source
|
2021-07-24 13:55:42 +00:00
|
|
|
type source interface {
|
2021-10-27 19:01:00 +00:00
|
|
|
onSourceAPIDescribe() interface{}
|
2021-07-24 13:55:42 +00:00
|
|
|
}
|
|
|
|
|
2021-07-31 18:46:06 +00:00
|
|
|
// sourceStatic is an entity that can provide a static stream.
|
|
|
|
type sourceStatic interface {
|
|
|
|
source
|
2021-10-27 19:01:00 +00:00
|
|
|
close()
|
2021-07-24 13:55:42 +00:00
|
|
|
}
|
2022-05-03 12:38:45 +00:00
|
|
|
|
|
|
|
// sourceRedirect is a source that redirects to another one.
|
|
|
|
type sourceRedirect struct{}
|
|
|
|
|
|
|
|
// onSourceAPIDescribe implements source.
|
|
|
|
func (*sourceRedirect) onSourceAPIDescribe() interface{} {
|
|
|
|
return struct {
|
|
|
|
Type string `json:"type"`
|
|
|
|
}{"redirect"}
|
|
|
|
}
|