func (m *mechanism) DstPort() (int, error) {
	dstPortStr, err := m.stringValue(DstPort)
	if err != nil {
		return 0, err
	}
	dstPort, err := strconv.ParseInt(dstPortStr, 10, 64)
	if err != nil {
		return 0, errors.Wrapf(err, "cannot parse mechanism.Parameters[%s]=%v value", DstPort, dstPortStr)
	}
	return int(dstPort), nil
}
DstPort - Destination interface listening port
package wireguard
import (
	"strconv"
	"github.com/pkg/errors"
	"github.com/networkservicemesh/networkservicemesh/controlplane/api/connection"
	"github.com/networkservicemesh/networkservicemesh/controlplane/api/connection/mechanisms/common"
)
type Mechanism interface {
	SrcIP() (string, error)
	DstIP() (string, error)
	SrcPublicKey() (string, error)
	DstPublicKey() (string, error)
	SrcPrivateKey() (string, error)
	DstPrivateKey() (string, error)
	SrcPort() (int, error)
	DstPort() (int, error)
}
type mechanism struct {
	*connection.Mechanism
}
func ToMechanism(m *connection.Mechanism) Mechanism {
	if m.Type == MECHANISM {
		return &mechanism{
			m,
		}
	}
	return nil
}
func (m *mechanism) SrcIP() (string, error) {
	return common.GetSrcIP(m.Mechanism)
}
func (m *mechanism) DstIP() (string, error) {
	return common.GetDstIP(m.Mechanism)
}
func (m *mechanism) stringValue(parameter string) (string, error) {
	if m == nil {
		return "", errors.New("mechanism cannot be nil")
	}
	if m.GetParameters() == nil {
		return "", errors.Errorf("mechanism.Parameters cannot be nil: %v", m)
	}
	value, ok := m.Parameters[parameter]
	if !ok {
		return "", errors.Errorf("mechanism.Type %s requires mechanism.Parameters[%s]", m.GetType(), parameter)
	}
	return value, nil
}
func (m *mechanism) SrcPublicKey() (string, error) {
	return m.stringValue(SrcPublicKey)
}
func (m *mechanism) DstPublicKey() (string, error) {
	return m.stringValue(DstPublicKey)
}
func (m *mechanism) SrcPrivateKey() (string, error) {
	return m.stringValue(SrcPrivateKey)
}
func (m *mechanism) DstPrivateKey() (string, error) {
	return m.stringValue(DstPrivateKey)
}
func (m *mechanism) SrcPort() (int, error) {
	srcPortStr, err := m.stringValue(SrcPort)
	if err != nil {
		return 0, err
	}
	srcPort, err := strconv.ParseInt(srcPortStr, 10, 64)
	if err != nil {
		return 0, errors.Wrapf(err, "cannot parse mechanism.Parameters[%s]=%v value", SrcPort, srcPortStr)
	}
	return int(srcPort), nil
}