def getGolangPackages(self):
packages = {}<EOL>url = "<STR_LIT>" % self.base_url<EOL>params = {"<STR_LIT>": "<STR_LIT>", "<STR_LIT>": <NUM_LIT:200>}<EOL>response = requests.get(url, params=params)<EOL>if response.status_code != requests.codes.ok:<EOL><INDENT>return {}<EOL><DEDENT>data = response.json()<EOL>for package in data["<STR_LIT>"]:<EOL><INDENT>packages[package["<STR_LIT:name>"]] = self._processPackageData(package)<EOL><DEDENT>for page in range(<NUM_LIT:2>, data["<STR_LIT>"] + <NUM_LIT:1>):<EOL><INDENT>params = {"<STR_LIT>": "<STR_LIT>", "<STR_LIT>": <NUM_LIT:200>, "<STR_LIT>": page}<EOL>response = requests.get(url, params=params)<EOL>if response.status_code != requests.codes.ok:<EOL><INDENT>continue<EOL><DEDENT>data = response.json()<EOL>for package in data["<STR_LIT>"]:<EOL><INDENT>packages[package["<STR_LIT:name>"]] = self._processPackageData(package)<EOL><DEDENT><DEDENT>MAX_LEN = <NUM_LIT:30><EOL>package_names = packages.keys()<EOL>packages_total = len(package_names)<EOL>packages_counter = <NUM_LIT:0><EOL>logger.info("<STR_LIT>" % packages_total)<EOL>for i in range(<NUM_LIT:0>, packages_total, MAX_LEN):<EOL><INDENT>sublist = package_names[i:i+MAX_LEN]<EOL>branches = self._getPackageBranches(sublist)<EOL>for package in sublist:<EOL><INDENT>packages[package]["<STR_LIT>"] = branches[package]<EOL><DEDENT>packages_counter = packages_counter + len(branches)<EOL>logger.info("<STR_LIT>" %<EOL>(packages_counter, packages_total))<EOL><DEDENT>return packages<EOL>
Get a list of all golang packages for all available branches