func GetMgsEndpoint(region string) (mgsEndpoint string) {
	if appConfig, err := appconfig.Config(false); err == nil {
		if appConfig.Mgs.Endpoint != "" {
			// use net/url package to parse endpoint, if endpoint doesn't contain protocol,
			// fullUrl.Host is empty, should return fullUrl.Path. For backwards compatible, return the non-empty one.
			fullUrl, err := url.Parse(appConfig.Mgs.Endpoint)
			if err != nil {
				return ""
			}
			if fullUrl.Host != "" {
				return fullUrl.Host
			}
			return fullUrl.Path
		}
	}

	if mgsEndpoint, ok := awsMessageGatewayServiceEndpointMap[region]; ok {
		return mgsEndpoint
	}

	mgsEndpoint = ""
	if region, err := platform.Region(); err == nil {
		mgsEndpoint = GetDefaultServiceEndpoint(region, MgsServiceName)
	}
	return mgsEndpoint
}
/* This function returns the mgs endpoint specified by the user in appconfig.
If the user didn't specify one, it will return the Amazon MGS endpoint in a certain region
*/
This function returns the mgs endpoint specified by the user in appconfig.
If the user didn't specify one, it will return the Amazon MGS endpoint in a certain region
/ * This function returns the mgs endpoint specified by the user in appconfig . If the user didn ' t specify one it will return the Amazon MGS endpoint in a certain region * /
func GetMgsEndpoint(region string) (mgsEndpoint string) {
	if appConfig, err := appconfig.Config(false); err == nil {
		if appConfig.Mgs.Endpoint != "" {
			fullUrl, err := url.Parse(appConfig.Mgs.Endpoint)
			if err != nil {
				return ""
			}
			if fullUrl.Host != "" {
				return fullUrl.Host
			}
			return fullUrl.Path
		}
	}
	if mgsEndpoint, ok := awsMessageGatewayServiceEndpointMap[region]; ok {
		return mgsEndpoint
	}
	mgsEndpoint = ""
	if region, err := platform.Region(); err == nil {
		mgsEndpoint = GetDefaultServiceEndpoint(region, MgsServiceName)
	}
	return mgsEndpoint
}
func GetMgsEndpoint ( region string ) ( mgsEndpoint string ) { if appConfig , err := appconfig . Config ( false ) ; err == nil { if appConfig . Mgs . Endpoint != " " { fullUrl , err := url . Parse ( appConfig . Mgs . Endpoint ) if err != nil { return " " } if fullUrl . Host != " " { return fullUrl . Host } return fullUrl . Path } } if mgsEndpoint , ok := awsMessageGatewayServiceEndpointMap [ region ] ; ok { return mgsEndpoint } mgsEndpoint = " " if region , err := platform . Region ( ) ; err == nil { mgsEndpoint = GetDefaultServiceEndpoint ( region , MgsServiceName ) } return mgsEndpoint }
This function returns the mgs endpoint specified by the user in appconfig.
This function returns the mgs endpoint specified by the user in appconfig .
// use net/url package to parse endpoint, if endpoint doesn't contain protocol, // fullUrl.Host is empty, should return fullUrl.Path. For backwards compatible, return the non-empty one.