func (resolver *LocationResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) {
	if len(param.LocationProduct) <= 0 {
		support = false
		return
	}
	cacheKey := param.Product + "#" + param.RegionId
	var ok bool
	endpoint, ok = endpointCache.Get(cacheKey).(string)
	if ok && len(endpoint) > 0 && !CheckCacheIsExpire(cacheKey) {
		support = true
		return
	}
	getEndpointRequest := requests.NewCommonRequest()
	getEndpointRequest.Product = "Location"
	getEndpointRequest.Version = "2015-06-12"
	getEndpointRequest.ApiName = "DescribeEndpoints"
	getEndpointRequest.Domain = "location-readonly.aliyuncs.com"
	getEndpointRequest.Method = "GET"
	getEndpointRequest.Scheme = requests.HTTPS
	getEndpointRequest.QueryParams["Id"] = param.RegionId
	getEndpointRequest.QueryParams["ServiceCode"] = param.LocationProduct
	if len(param.LocationEndpointType) > 0 {
		getEndpointRequest.QueryParams["Type"] = param.LocationEndpointType
	} else {
		getEndpointRequest.QueryParams["Type"] = "openAPI"
	}
	response, err := param.CommonApi(getEndpointRequest)
	if err != nil {
		support = false
		return
	}
	if !response.IsSuccess() {
		support = false
		return
	}
	var getEndpointResponse GetEndpointResponse
	err = json.Unmarshal([]byte(response.GetHttpContentString()), &getEndpointResponse)
	if err != nil {
		support = false
		return
	}
	if !getEndpointResponse.Success || getEndpointResponse.Endpoints == nil {
		support = false
		return
	}
	if len(getEndpointResponse.Endpoints.Endpoint) <= 0 {
		support = false
		return
	}
	if len(getEndpointResponse.Endpoints.Endpoint[0].Endpoint) > 0 {
		endpoint = getEndpointResponse.Endpoints.Endpoint[0].Endpoint
		endpointCache.Set(cacheKey, endpoint)
		lastClearTimePerProduct.Set(cacheKey, time.Now().Unix())
		support = true
		return
	}
	support = false
	return
}
TryResolve resolves endpoint giving product and region
package endpoints
import (
	"encoding/json"
	"sync"
	"time"
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
)
const (
	EndpointCacheExpireTime = 3600  
)
type Cache struct {
	sync.RWMutex
	cache map[string]interface{}
}
func (c *Cache) Get(k string) (v interface{}) {
	c.RLock()
	v = c.cache[k]
	c.RUnlock()
	return
}
func (c *Cache) Set(k string, v interface{}) {
	c.Lock()
	c.cache[k] = v
	c.Unlock()
}
var lastClearTimePerProduct = &Cache{cache: make(map[string]interface{})}
var endpointCache = &Cache{cache: make(map[string]interface{})}
type LocationResolver struct {
}
func (resolver *LocationResolver) GetName() (name string) {
	name = "location resolver"
	return
}