()
| 33 | ) |
| 34 | |
| 35 | func init() { |
| 36 | registry.Register(&plugin.Registration{ |
| 37 | Type: plugins.StreamingPlugin, |
| 38 | ID: "manager", |
| 39 | Requires: []plugin.Type{ |
| 40 | plugins.MetadataPlugin, |
| 41 | }, |
| 42 | InitFn: func(ic *plugin.InitContext) (any, error) { |
| 43 | md, err := ic.GetSingle(plugins.MetadataPlugin) |
| 44 | if err != nil { |
| 45 | return nil, err |
| 46 | } |
| 47 | |
| 48 | sm := &streamManager{ |
| 49 | streams: map[string]map[string]*managedStream{}, |
| 50 | byLease: map[string]map[string]map[string]struct{}{}, |
| 51 | } |
| 52 | md.(*metadata.DB).RegisterCollectibleResource(metadata.ResourceStream, sm) |
| 53 | return sm, nil |
| 54 | }, |
| 55 | }) |
| 56 | } |
| 57 | |
| 58 | type streamManager struct { |
| 59 | // streams maps namespace -> name -> stream |
nothing calls this directly
no test coverage detected
searching dependent graphs…