probe/discovery/session/mock-discovery-session.go
crusader ffd94e2c8e ing
2018-08-29 21:04:23 +09:00

42 lines
1.1 KiB
Go

package session
import (
omd "git.loafle.net/overflow/model/discovery"
"git.loafle.net/overflow_scanner/probe/discovery/types"
)
func MockDiscoverySession() *mockDiscoverySession {
return &mockDiscoverySession{}
}
type mockDiscoverySession struct {
ofDiscoverySession
}
func (ds *mockDiscoverySession) InitWithDiscoverHost(request types.DiscoveryRequest, zone *omd.Zone, discoverHost *omd.DiscoverHost) {
ds.setZone(zone)
ds.setDiscoverHost(discoverHost)
}
func (ds *mockDiscoverySession) InitWithDiscoverPort(request types.DiscoveryRequest, host *omd.Host, discoverPort *omd.DiscoverPort) {
ds.setHost(host)
ds.setDiscoverPort(discoverPort)
}
func (ds *mockDiscoverySession) InitWithDiscoverService(request types.DiscoveryRequest, port *omd.Port, discoverService *omd.DiscoverService) {
ds.setPort(port)
ds.setDiscoverService(discoverService)
}
func (ds *mockDiscoverySession) AddHost(host *omd.Host) *omd.Host {
return host
}
func (ds *mockDiscoverySession) AddPort(port *omd.Port) *omd.Port {
return port
}
func (ds *mockDiscoverySession) AddService(service *omd.Service) *omd.Service {
return service
}