Moved GetEndpointInfo logic to Endpoint class
This commit is contained in:
Родитель
23258937c7
Коммит
3567ac1e5a
|
@ -246,6 +246,20 @@ func (nw *network) getEndpoint(endpointId string) (*endpoint, error) {
|
|||
return ep, nil
|
||||
}
|
||||
|
||||
//
|
||||
// Endpoint
|
||||
//
|
||||
|
||||
// GetInfo returns information about the endpoint.
|
||||
func (ep *endpoint) getInfo() *EndpointInfo {
|
||||
info := &EndpointInfo{
|
||||
Id: ep.Id,
|
||||
IPv4Address: ep.IPv4Address,
|
||||
}
|
||||
|
||||
return info
|
||||
}
|
||||
|
||||
// Attach attaches an endpoint to a sandbox.
|
||||
func (ep *endpoint) attach(sandboxKey string, options map[string]interface{}) error {
|
||||
if ep.SandboxKey != "" {
|
||||
|
|
|
@ -249,12 +249,7 @@ func (nm *networkManager) GetEndpointInfo(networkId string, endpointId string) (
|
|||
return nil, err
|
||||
}
|
||||
|
||||
epInfo := &EndpointInfo{
|
||||
Id: endpointId,
|
||||
IPv4Address: ep.IPv4Address,
|
||||
}
|
||||
|
||||
return epInfo, nil
|
||||
return ep.getInfo(), nil
|
||||
}
|
||||
|
||||
// AttachEndpoint attaches an endpoint to a sandbox.
|
||||
|
|
Загрузка…
Ссылка в новой задаче