et-go 20240919重建
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

30 lines
540 B

package dataSource
import (
"gitea.anxinyun.cn/container/common_models"
"sync"
)
type DataChannels struct {
RawDataChan chan common_models.IotaData
AggDataChan chan common_models.AggData
}
var (
once sync.Once
dataChannels *DataChannels
)
func InitChannels() *DataChannels {
once.Do(func() {
dataChannels = &DataChannels{
RawDataChan: make(chan common_models.IotaData, 1),
AggDataChan: make(chan common_models.AggData, 1),
}
})
return dataChannels
}
func GetChannels() *DataChannels {
return dataChannels
}