Example #1
0
func (this *MenuSubItem) httpget(geturl string) (map[string]interface{}, error) {
	if publicdefine.CurrProxyInfo == nil || publicdefine.CurrProxyInfo.Enabled == false {
		return publicdefine.HttpGet(geturl)
	} else if len(publicdefine.CurrProxyInfo.UserName) == 0 {
		return publicdefine.HttpProxyGet(geturl, publicdefine.CurrProxyInfo.IP,
			publicdefine.CurrProxyInfo.Port)
	}

	return publicdefine.HttpProxyGet(geturl, publicdefine.CurrProxyInfo.IP,
		publicdefine.CurrProxyInfo.Port,
		&proxy.Auth{
			User:     publicdefine.CurrProxyInfo.UserName,
			Password: publicdefine.CurrProxyInfo.Password,
		})
}
Example #2
0
func (this *MergeAccount) checkSourceAddr(addr string) *publicdefine.StellarAccInfoDef {
	reqUrl := publicdefine.STELLAR_DEFAULT_NETWORK + publicdefine.STELLAR_NETWORK_ACCOUNTS + "/" + addr
	resMap, err := publicdefine.HttpGet(reqUrl)

	if err == nil {
		ret := &publicdefine.StellarAccInfoDef{}
		ret.PutMapBody(addr, resMap)
		if ret.IsExist() {
			return ret
		} else {
			ConsoleColor.Printf(ConsoleColor.C_RED,
				this.infoStrings[this.languageIndex][MA_INFO_SOURCE_ACCOUNT_NOT_EXIST]+"\r\n", addr)
			// fmt.Printf(this.infoStrings[this.languageIndex][MA_INFO_SOURCE_ACCOUNT_NOT_EXIST]+"\r\n", addr)
		}
	} else {
		ConsoleColor.Println(ConsoleColor.C_RED, err)
		// fmt.Println(err)
	}
	return nil
}