59 lines
1.4 KiB
Go
59 lines
1.4 KiB
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
"reflect"
|
|
|
|
cda "git.loafle.net/commons_go/di/annotation"
|
|
cdr "git.loafle.net/commons_go/di/registry"
|
|
oocmci "git.loafle.net/overflow/overflow_commons_go/modules/commons/interfaces"
|
|
discoveryM "git.loafle.net/overflow/overflow_commons_go/modules/discovery/model"
|
|
"git.loafle.net/overflow/overflow_discovery/discovery"
|
|
oopcs "git.loafle.net/overflow/overflow_probe_container/service"
|
|
)
|
|
|
|
func init() {
|
|
cdr.RegisterType(reflect.TypeOf((*DiscoveryService)(nil)))
|
|
}
|
|
|
|
type DiscoveryService struct {
|
|
cda.TypeAnnotation `annotation:"@overFlow:Service()"`
|
|
oocmci.Service
|
|
|
|
ProbeService *oopcs.ProbeService `annotation:"@Inject()"`
|
|
}
|
|
|
|
func (ds *DiscoveryService) Start() error {
|
|
discovery.DiscoveryInit()
|
|
|
|
return nil
|
|
}
|
|
|
|
func (ds *DiscoveryService) Stop(ctx context.Context) error {
|
|
discovery.DiscoveryDestroy()
|
|
|
|
return nil
|
|
}
|
|
|
|
func (ds *DiscoveryService) DiscoverZone(requesterID string, dz *discoveryM.DiscoveryZone) error {
|
|
|
|
discovery.DiscoverZone(ds.ProbeService, requesterID, dz)
|
|
|
|
return nil
|
|
}
|
|
|
|
func (ds *DiscoveryService) DiscoverHost(requesterID string, zone *discoveryM.Zone, dz *discoveryM.DiscoveryHost) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
func (ds *DiscoveryService) DiscoverPort(requesterID string, host *discoveryM.Host, dz *discoveryM.DiscoveryPort) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
func (ds *DiscoveryService) DiscoverService(requesterID string, port *discoveryM.Port, dz *discoveryM.DiscoveryService) error {
|
|
|
|
return nil
|
|
}
|