mirror of
https://github.com/datarhei/core.git
synced 2025-10-16 13:00:37 +08:00

- rebrand group to domain - move IAM to the API (rest and graph) for enforcing "process:" rules - add abstraction layer for restream store in order to decouple internal format from format on disk - move playout handler into restreamHandler - remove user from restream interface - add TaskID type that includes the process id and its domain
43 lines
647 B
Go
43 lines
647 B
Go
package store
|
|
|
|
import "github.com/datarhei/core/v16/restream/app"
|
|
|
|
type Process struct {
|
|
Process *app.Process
|
|
Metadata map[string]interface{}
|
|
}
|
|
|
|
type Data struct {
|
|
Process map[string]map[string]Process
|
|
Metadata map[string]interface{}
|
|
}
|
|
|
|
func (d *Data) IsEmpty() bool {
|
|
if len(d.Process) != 0 {
|
|
return false
|
|
}
|
|
|
|
if len(d.Metadata) != 0 {
|
|
return false
|
|
}
|
|
|
|
return true
|
|
}
|
|
|
|
type Store interface {
|
|
// Load data from the store
|
|
Load() (Data, error)
|
|
|
|
// Save data to the store
|
|
Store(Data) error
|
|
}
|
|
|
|
func NewData() Data {
|
|
c := Data{
|
|
Process: make(map[string]map[string]Process),
|
|
Metadata: make(map[string]interface{}),
|
|
}
|
|
|
|
return c
|
|
}
|