Documentation ¶
Overview ¶
Package svc provides definitions for services that run on the center.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCfgService ¶
func NewCfgService(c *CfgServiceCfg) *cfgService
NewCfgService creates and initializes a new instance of cfgService.
func NewDataService ¶
func NewDataService(c *DataServiceCfg) *dataService
NewDataService creates and initializes a new instance of dataService.
func NewStreamService ¶
func NewStreamService(c *StreamServiceCfg) *streamService
NewStreamService creates and initializes a new instance of streamService service.
Types ¶
type CfgServiceCfg ¶
type CfgServiceCfg struct { Log log.Logger Ctrl Ctrl Metric *metric.Metric Store CfgStorer Publisher Publisher SubChan <-chan *model.Cfg }
CfgServiceCfg is used to initialize an instance of cfgService.
type CfgStorer ¶
type CfgStorer interface { InitCfg(*model.Meta) (*model.Cfg, error) SetCfg(devID string, t model.Type, c *model.Cfg) error GetCfg(devID string, t model.Type) (*model.Cfg, error) GetDefaultCfg(devID string, t model.Type) (*model.Cfg, error) SetMeta(m *model.Meta) error IsRegistered(devID string, t model.Type) (bool, error) }
CfgStorer is a contract for the configuration storer.
type Ctrl ¶
type Ctrl struct {
StopChan chan struct{}
}
Ctrl contains StopChan that allows to terminate all the services that listen to the channel.
type DataPublisher ¶
Publisher .
type DataServiceCfg ¶
type DataServiceCfg struct { Log log.Logger Ctrl Ctrl Metric *metric.Metric Store DataStorer PubChan chan<- *model.Data }
DataServiceCfg is used to initialize an instance of dataService.
Click to show internal directories.
Click to hide internal directories.