code: func ParseEndpointConnectivity(epOptions map[string]interface{}) (*EndpointConnectivity, error) {
  	if epOptions == nil {
  		return nil, nil
  	}
  
  	ec := &EndpointConnectivity{}
  
  	if opt, ok := epOptions[netlabel.PortMap]; ok {
  		if bs, ok := opt.([]types.PortBinding); ok {
  			ec.PortBindings = bs
  		} else {
  			return nil, fmt.Errorf("Invalid endpoint configuration")
  		}
  	}
  
  	if opt, ok := epOptions[netlabel.ExposedPorts]; ok {
  		if ports, ok := opt.([]types.TransportPort); ok {
  			ec.ExposedPorts = ports
  		} else {
  			return nil, fmt.Errorf("Invalid endpoint configuration")
  		}
  	}
  	return ec, nil
  }
docs: // ParseEndpointConnectivity parses options passed to CreateEndpoint, specifically port bindings, and store in a endpointConnectivity object.