func (c *CrossConnect) GetLocalSource() *connection.Connection {
	if c == nil {
		return nil
	}
	if c.Source.IsRemote() {
		return nil
	}
	return c.Source
}
GetLocalSource - return a source and check if it is local
package crossconnect
import (
	"github.com/pkg/errors"
	"github.com/networkservicemesh/networkservicemesh/controlplane/api/connection"
)
func NewCrossConnect(id, payload string, src, dst *connection.Connection) *CrossConnect {
	c := &CrossConnect{
		Id:          id,
		Payload:     payload,
		Source:      src,
		Destination: dst,
	}
	return c
}
func (c *CrossConnect) IsValid() error {
	if c == nil {
		return errors.New("crossConnect cannot be nil")
	}
	if c.GetId() == "" {
		return errors.Errorf("crossConnect.Id cannot be empty: %v", c)
	}
	src := c.GetSource()
	if src == nil {
		return errors.Errorf("crossConnect.Source cannot be nil: %v", c)
	}
	if err := src.IsValid(); err != nil {
		return errors.Wrapf(err, "crossConnect.Source %v invalid", c)
	}
	dst := c.GetDestination()
	if dst == nil {
		return errors.Errorf("crossConnect.Destination cannot be nil: %v", c)
	}
	if err := dst.IsValid(); err != nil {
		return errors.Wrapf(err, "crossConnect.Destination %v invalid", c)
	}
	if c.GetPayload() == "" {
		return errors.Errorf("crossConnect.Payload cannot be empty: %v", c)
	}
	return nil
}
func (c *CrossConnect) IsComplete() error {
	if err := c.IsValid(); err != nil {
		return err
	}
	if err := c.GetSource().IsComplete(); err != nil {
		return errors.Wrapf(err, "crossConnect.Source %v invalid", c)
	}
	if err := c.GetDestination().IsComplete(); err != nil {
		return errors.Wrapf(err, "crossConnect.Destination %v invalid", c)
	}
	return nil
}