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 }