├── .github └── CODEOWNERS ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── blizzard.go ├── d3c.go ├── d3c ├── act.go ├── artisanRecipe.go ├── characterClassAndSkill.go ├── d3c.go ├── follower.go ├── item.go ├── itemType.go └── profile.go ├── d3c_test.go ├── d3gd.go ├── d3gd ├── d3.go └── d3gd.go ├── d3gd_test.go ├── errors.go ├── examples ├── authCodeFlow │ └── main.go ├── search │ └── main.go └── simpleClient │ └── main.go ├── go.mod ├── go.sum ├── header.go ├── hsgd.go ├── hsgd ├── cardBacks.go ├── cardSearch.go ├── decks.go ├── hsgd.go └── metadata.go ├── hsgd_test.go ├── init_test.go ├── oauth.go ├── oauth ├── oauth.go ├── tokenValidation.go └── userAuthentication.go ├── oauth_test.go ├── owl.go ├── owl ├── matchesAPI.go ├── playersAPI.go ├── segementsAPI.go ├── summaryData.go └── teamsAPI.go ├── owl_test.go ├── region_string.go ├── sc2c.go ├── sc2c ├── account.go ├── ladder.go ├── legacy.go ├── profile.go └── sc2c.go ├── sc2c_test.go ├── sc2gd.go ├── sc2gd ├── ladder.go ├── league.go └── sc2gd.go ├── sc2gd_test.go ├── vendor ├── github.com │ ├── go-playground │ │ ├── locales │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── currency │ │ │ │ └── currency.go │ │ │ ├── logo.png │ │ │ └── rules.go │ │ ├── universal-translator │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── errors.go │ │ │ ├── import_export.go │ │ │ ├── logo.png │ │ │ ├── translator.go │ │ │ └── universal_translator.go │ │ └── validator │ │ │ └── v10 │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── MAINTAINERS.md │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── baked_in.go │ │ │ ├── cache.go │ │ │ ├── country_codes.go │ │ │ ├── currency_codes.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── field_level.go │ │ │ ├── logo.png │ │ │ ├── postcode_regexes.go │ │ │ ├── regexes.go │ │ │ ├── struct_level.go │ │ │ ├── translations.go │ │ │ ├── util.go │ │ │ ├── validator.go │ │ │ └── validator_instance.go │ ├── golang │ │ └── protobuf │ │ │ ├── AUTHORS │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ └── proto │ │ │ ├── buffer.go │ │ │ ├── defaults.go │ │ │ ├── deprecated.go │ │ │ ├── discard.go │ │ │ ├── extensions.go │ │ │ ├── properties.go │ │ │ ├── proto.go │ │ │ ├── registry.go │ │ │ ├── text_decode.go │ │ │ ├── text_encode.go │ │ │ ├── wire.go │ │ │ └── wrappers.go │ └── leodido │ │ └── go-urn │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── machine.go │ │ ├── machine.go.rl │ │ ├── makefile │ │ └── urn.go ├── golang.org │ └── x │ │ ├── crypto │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── sha3 │ │ │ ├── doc.go │ │ │ ├── hashes.go │ │ │ ├── hashes_noasm.go │ │ │ ├── keccakf.go │ │ │ ├── keccakf_amd64.go │ │ │ ├── keccakf_amd64.s │ │ │ ├── sha3.go │ │ │ ├── sha3_s390x.go │ │ │ ├── sha3_s390x.s │ │ │ ├── shake.go │ │ │ └── shake_noasm.go │ │ ├── net │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── context │ │ │ └── context.go │ │ ├── oauth2 │ │ ├── .travis.yml │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── clientcredentials │ │ │ └── clientcredentials.go │ │ ├── internal │ │ │ ├── client_appengine.go │ │ │ ├── doc.go │ │ │ ├── oauth2.go │ │ │ ├── token.go │ │ │ └── transport.go │ │ ├── oauth2.go │ │ ├── token.go │ │ └── transport.go │ │ ├── sys │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── cpu │ │ │ ├── asm_aix_ppc64.s │ │ │ ├── asm_darwin_x86_gc.s │ │ │ ├── byteorder.go │ │ │ ├── cpu.go │ │ │ ├── cpu_aix.go │ │ │ ├── cpu_arm.go │ │ │ ├── cpu_arm64.go │ │ │ ├── cpu_arm64.s │ │ │ ├── cpu_darwin_x86.go │ │ │ ├── cpu_gc_arm64.go │ │ │ ├── cpu_gc_s390x.go │ │ │ ├── cpu_gc_x86.go │ │ │ ├── cpu_gc_x86.s │ │ │ ├── cpu_gccgo_arm64.go │ │ │ ├── cpu_gccgo_s390x.go │ │ │ ├── cpu_gccgo_x86.c │ │ │ ├── cpu_gccgo_x86.go │ │ │ ├── cpu_linux.go │ │ │ ├── cpu_linux_arm.go │ │ │ ├── cpu_linux_arm64.go │ │ │ ├── cpu_linux_mips64x.go │ │ │ ├── cpu_linux_noinit.go │ │ │ ├── cpu_linux_ppc64x.go │ │ │ ├── cpu_linux_riscv64.go │ │ │ ├── cpu_linux_s390x.go │ │ │ ├── cpu_loong64.go │ │ │ ├── cpu_mips64x.go │ │ │ ├── cpu_mipsx.go │ │ │ ├── cpu_netbsd_arm64.go │ │ │ ├── cpu_openbsd_arm64.go │ │ │ ├── cpu_openbsd_arm64.s │ │ │ ├── cpu_other_arm.go │ │ │ ├── cpu_other_arm64.go │ │ │ ├── cpu_other_mips64x.go │ │ │ ├── cpu_other_ppc64x.go │ │ │ ├── cpu_other_riscv64.go │ │ │ ├── cpu_other_x86.go │ │ │ ├── cpu_ppc64x.go │ │ │ ├── cpu_riscv64.go │ │ │ ├── cpu_s390x.go │ │ │ ├── cpu_s390x.s │ │ │ ├── cpu_wasm.go │ │ │ ├── cpu_x86.go │ │ │ ├── cpu_zos.go │ │ │ ├── cpu_zos_s390x.go │ │ │ ├── endian_big.go │ │ │ ├── endian_little.go │ │ │ ├── hwcap_linux.go │ │ │ ├── parse.go │ │ │ ├── proc_cpuinfo_linux.go │ │ │ ├── runtime_auxv.go │ │ │ ├── runtime_auxv_go121.go │ │ │ ├── syscall_aix_gccgo.go │ │ │ ├── syscall_aix_ppc64_gc.go │ │ │ └── syscall_darwin_x86_gc.go │ │ └── text │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── internal │ │ ├── language │ │ │ ├── common.go │ │ │ ├── compact.go │ │ │ ├── compact │ │ │ │ ├── compact.go │ │ │ │ ├── language.go │ │ │ │ ├── parents.go │ │ │ │ ├── tables.go │ │ │ │ └── tags.go │ │ │ ├── compose.go │ │ │ ├── coverage.go │ │ │ ├── language.go │ │ │ ├── lookup.go │ │ │ ├── match.go │ │ │ ├── parse.go │ │ │ ├── tables.go │ │ │ └── tags.go │ │ └── tag │ │ │ └── tag.go │ │ └── language │ │ ├── coverage.go │ │ ├── doc.go │ │ ├── language.go │ │ ├── match.go │ │ ├── parse.go │ │ ├── tables.go │ │ └── tags.go ├── google.golang.org │ ├── appengine │ │ ├── LICENSE │ │ ├── internal │ │ │ ├── api.go │ │ │ ├── api_classic.go │ │ │ ├── api_common.go │ │ │ ├── app_id.go │ │ │ ├── base │ │ │ │ ├── api_base.pb.go │ │ │ │ └── api_base.proto │ │ │ ├── datastore │ │ │ │ ├── datastore_v3.pb.go │ │ │ │ └── datastore_v3.proto │ │ │ ├── identity.go │ │ │ ├── identity_classic.go │ │ │ ├── identity_flex.go │ │ │ ├── identity_vm.go │ │ │ ├── internal.go │ │ │ ├── log │ │ │ │ ├── log_service.pb.go │ │ │ │ └── log_service.proto │ │ │ ├── main.go │ │ │ ├── main_common.go │ │ │ ├── main_vm.go │ │ │ ├── metadata.go │ │ │ ├── net.go │ │ │ ├── regen.sh │ │ │ ├── remote_api │ │ │ │ ├── remote_api.pb.go │ │ │ │ └── remote_api.proto │ │ │ ├── transaction.go │ │ │ └── urlfetch │ │ │ │ ├── urlfetch_service.pb.go │ │ │ │ └── urlfetch_service.proto │ │ └── urlfetch │ │ │ └── urlfetch.go │ └── protobuf │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── encoding │ │ ├── prototext │ │ │ ├── decode.go │ │ │ ├── doc.go │ │ │ └── encode.go │ │ └── protowire │ │ │ └── wire.go │ │ ├── internal │ │ ├── descfmt │ │ │ └── stringer.go │ │ ├── descopts │ │ │ └── options.go │ │ ├── detrand │ │ │ └── rand.go │ │ ├── editiondefaults │ │ │ ├── defaults.go │ │ │ └── editions_defaults.binpb │ │ ├── encoding │ │ │ ├── defval │ │ │ │ └── default.go │ │ │ ├── messageset │ │ │ │ └── messageset.go │ │ │ ├── tag │ │ │ │ └── tag.go │ │ │ └── text │ │ │ │ ├── decode.go │ │ │ │ ├── decode_number.go │ │ │ │ ├── decode_string.go │ │ │ │ ├── decode_token.go │ │ │ │ ├── doc.go │ │ │ │ └── encode.go │ │ ├── errors │ │ │ ├── errors.go │ │ │ ├── is_go112.go │ │ │ └── is_go113.go │ │ ├── filedesc │ │ │ ├── build.go │ │ │ ├── desc.go │ │ │ ├── desc_init.go │ │ │ ├── desc_lazy.go │ │ │ ├── desc_list.go │ │ │ ├── desc_list_gen.go │ │ │ ├── editions.go │ │ │ └── placeholder.go │ │ ├── filetype │ │ │ └── build.go │ │ ├── flags │ │ │ ├── flags.go │ │ │ ├── proto_legacy_disable.go │ │ │ └── proto_legacy_enable.go │ │ ├── genid │ │ │ ├── any_gen.go │ │ │ ├── api_gen.go │ │ │ ├── descriptor_gen.go │ │ │ ├── doc.go │ │ │ ├── duration_gen.go │ │ │ ├── empty_gen.go │ │ │ ├── field_mask_gen.go │ │ │ ├── go_features_gen.go │ │ │ ├── goname.go │ │ │ ├── map_entry.go │ │ │ ├── source_context_gen.go │ │ │ ├── struct_gen.go │ │ │ ├── timestamp_gen.go │ │ │ ├── type_gen.go │ │ │ ├── wrappers.go │ │ │ └── wrappers_gen.go │ │ ├── impl │ │ │ ├── api_export.go │ │ │ ├── checkinit.go │ │ │ ├── codec_extension.go │ │ │ ├── codec_field.go │ │ │ ├── codec_gen.go │ │ │ ├── codec_map.go │ │ │ ├── codec_map_go111.go │ │ │ ├── codec_map_go112.go │ │ │ ├── codec_message.go │ │ │ ├── codec_messageset.go │ │ │ ├── codec_reflect.go │ │ │ ├── codec_tables.go │ │ │ ├── codec_unsafe.go │ │ │ ├── convert.go │ │ │ ├── convert_list.go │ │ │ ├── convert_map.go │ │ │ ├── decode.go │ │ │ ├── encode.go │ │ │ ├── enum.go │ │ │ ├── extension.go │ │ │ ├── legacy_enum.go │ │ │ ├── legacy_export.go │ │ │ ├── legacy_extension.go │ │ │ ├── legacy_file.go │ │ │ ├── legacy_message.go │ │ │ ├── merge.go │ │ │ ├── merge_gen.go │ │ │ ├── message.go │ │ │ ├── message_reflect.go │ │ │ ├── message_reflect_field.go │ │ │ ├── message_reflect_gen.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── validate.go │ │ │ └── weak.go │ │ ├── order │ │ │ ├── order.go │ │ │ └── range.go │ │ ├── pragma │ │ │ └── pragma.go │ │ ├── set │ │ │ └── ints.go │ │ ├── strs │ │ │ ├── strings.go │ │ │ ├── strings_pure.go │ │ │ ├── strings_unsafe_go120.go │ │ │ └── strings_unsafe_go121.go │ │ └── version │ │ │ └── version.go │ │ ├── proto │ │ ├── checkinit.go │ │ ├── decode.go │ │ ├── decode_gen.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── encode_gen.go │ │ ├── equal.go │ │ ├── extension.go │ │ ├── merge.go │ │ ├── messageset.go │ │ ├── proto.go │ │ ├── proto_methods.go │ │ ├── proto_reflect.go │ │ ├── reset.go │ │ ├── size.go │ │ ├── size_gen.go │ │ └── wrappers.go │ │ ├── reflect │ │ ├── protodesc │ │ │ ├── desc.go │ │ │ ├── desc_init.go │ │ │ ├── desc_resolve.go │ │ │ ├── desc_validate.go │ │ │ ├── editions.go │ │ │ └── proto.go │ │ ├── protoreflect │ │ │ ├── methods.go │ │ │ ├── proto.go │ │ │ ├── source.go │ │ │ ├── source_gen.go │ │ │ ├── type.go │ │ │ ├── value.go │ │ │ ├── value_equal.go │ │ │ ├── value_pure.go │ │ │ ├── value_union.go │ │ │ ├── value_unsafe_go120.go │ │ │ └── value_unsafe_go121.go │ │ └── protoregistry │ │ │ └── registry.go │ │ ├── runtime │ │ ├── protoiface │ │ │ ├── legacy.go │ │ │ └── methods.go │ │ └── protoimpl │ │ │ ├── impl.go │ │ │ └── version.go │ │ └── types │ │ ├── descriptorpb │ │ └── descriptor.pb.go │ │ └── gofeaturespb │ │ ├── go_features.pb.go │ │ └── go_features.proto └── modules.txt ├── wow └── wow.go ├── wowcgd.go ├── wowcgd ├── auctionHouse.go ├── connectedRealm.go ├── creature.go ├── guildCrest.go ├── item.go ├── mediaSearch.go ├── playableClass.go ├── playableRace.go ├── powerType.go ├── pvpSeason.go ├── realm.go ├── region.go └── wowcgd.go ├── wowcgd_test.go ├── wowgd.go ├── wowgd ├── achievement.go ├── auctionHouse.go ├── auctionHouseCommodities.go ├── azeriteEssence.go ├── connectedRealm.go ├── convenant.go ├── creature.go ├── guildCrest.go ├── item.go ├── journal.go ├── mediaSearch.go ├── modifiedCrafting.go ├── mount.go ├── mythicKeystoneAffix.go ├── mythicKeystoneDungeon.go ├── mythicKeystoneLeaderboard.go ├── mythicRaidLeaderboard.go ├── pet.go ├── playableClass.go ├── playableRace.go ├── playableSpecialization.go ├── powerType.go ├── profession.go ├── pvpSeason.go ├── pvpTier.go ├── quest.go ├── realm.go ├── region.go ├── reputations.go ├── spell.go ├── talent.go ├── techTalent.go ├── title.go ├── wowToken.go └── wowgd.go ├── wowgd_test.go ├── wowp.go ├── wowp ├── accountProfileSummary.go ├── characterAchievements.go ├── characterAppearance.go ├── characterCollections.go ├── characterEncounters.go ├── characterEquipment.go ├── characterHunterPets.go ├── characterMedia.go ├── characterMythicKeystoneProfile.go ├── characterProfessions.go ├── characterProfile.go ├── characterPvP.go ├── characterQuests.go ├── characterReputations.go ├── characterSoulbinds.go ├── characterSpecializations.go ├── characterStatistics.go ├── characterTitles.go └── guild.go ├── wowp_test.go └── wowsearch ├── search.go └── search_test.go /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Lines starting with '#' are comments. 2 | # Each line is a file pattern followed by one or more owners. 3 | 4 | # These owners will be the default owners for everything in the repo. 5 | * @FuzzyStatic 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | credentials.toml -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Create a pull request and make sure to note the reasons for any changes or additions. Please adhere to current coding style and format. 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017-2023 Allen Flickinger 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /d3c/act.go: -------------------------------------------------------------------------------- 1 | package d3c 2 | 3 | // ActIndex contains slice of Acts 4 | type ActIndex struct { 5 | Acts []Act `json:"acts"` 6 | } 7 | 8 | // Act contains act data 9 | type Act struct { 10 | Slug string `json:"slug"` 11 | Number int `json:"number"` 12 | Name string `json:"name"` 13 | Quests []struct { 14 | ID int `json:"id"` 15 | Name string `json:"name"` 16 | Slug string `json:"slug"` 17 | } `json:"quests"` 18 | } 19 | -------------------------------------------------------------------------------- /d3c/characterClassAndSkill.go: -------------------------------------------------------------------------------- 1 | package d3c 2 | 3 | // Hero structure 4 | type Hero struct { 5 | Slug string `json:"slug"` 6 | Name string `json:"name"` 7 | MaleName string `json:"maleName"` 8 | FemaleName string `json:"femaleName"` 9 | Icon string `json:"icon"` 10 | SkillCategories []struct { 11 | Slug string `json:"slug"` 12 | Name string `json:"name"` 13 | } `json:"skillCategories"` 14 | Skills struct { 15 | Active []struct { 16 | Slug string `json:"slug"` 17 | Name string `json:"name"` 18 | Icon string `json:"icon"` 19 | Level int `json:"level"` 20 | TooltipURL string `json:"tooltipUrl"` 21 | Description string `json:"description"` 22 | DescriptionHTML string `json:"descriptionHtml"` 23 | } `json:"active"` 24 | Passive []struct { 25 | Slug string `json:"slug"` 26 | Name string `json:"name"` 27 | Icon string `json:"icon"` 28 | Level int `json:"level"` 29 | TooltipURL string `json:"tooltipUrl"` 30 | Description string `json:"description"` 31 | DescriptionHTML string `json:"descriptionHtml"` 32 | FlavorText string `json:"flavorText"` 33 | } `json:"passive"` 34 | } `json:"skills"` 35 | } 36 | 37 | // Skill structure 38 | type Skill struct { 39 | Skill struct { 40 | Slug string `json:"slug"` 41 | Name string `json:"name"` 42 | Icon string `json:"icon"` 43 | Level int `json:"level"` 44 | TooltipURL string `json:"tooltipUrl"` 45 | Description string `json:"description"` 46 | DescriptionHTML string `json:"descriptionHtml"` 47 | } `json:"skill"` 48 | Runes []struct { 49 | Slug string `json:"slug"` 50 | Type string `json:"type"` 51 | Name string `json:"name"` 52 | Level int `json:"level"` 53 | Description string `json:"description"` 54 | DescriptionHTML string `json:"descriptionHtml"` 55 | } `json:"runes"` 56 | } 57 | -------------------------------------------------------------------------------- /d3c/d3c.go: -------------------------------------------------------------------------------- 1 | // Package d3c contains types for the Diablo 3 Community APIs 2 | package d3c 3 | -------------------------------------------------------------------------------- /d3c/follower.go: -------------------------------------------------------------------------------- 1 | package d3c 2 | 3 | // Follower structure 4 | type Follower struct { 5 | Slug string `json:"slug"` 6 | Name string `json:"name"` 7 | RealName string `json:"realName"` 8 | Portrait string `json:"portrait"` 9 | Skills []struct { 10 | Slug string `json:"slug"` 11 | Name string `json:"name"` 12 | Icon string `json:"icon"` 13 | Level int `json:"level"` 14 | TooltipURL string `json:"tooltipUrl"` 15 | Description string `json:"description"` 16 | DescriptionHTML string `json:"descriptionHtml"` 17 | } `json:"skills"` 18 | } 19 | -------------------------------------------------------------------------------- /d3c/item.go: -------------------------------------------------------------------------------- 1 | package d3c 2 | 3 | // Item structure 4 | type Item struct { 5 | ID string `json:"id"` 6 | Slug string `json:"slug"` 7 | Name string `json:"name"` 8 | Icon string `json:"icon"` 9 | TooltipParams string `json:"tooltipParams"` 10 | RequiredLevel int `json:"requiredLevel"` 11 | StackSizeMax int `json:"stackSizeMax"` 12 | AccountBound bool `json:"accountBound"` 13 | FlavorText string `json:"flavorText"` 14 | FlavorTextHTML string `json:"flavorTextHtml"` 15 | TypeName string `json:"typeName"` 16 | Type struct { 17 | TwoHanded bool `json:"twoHanded"` 18 | ID string `json:"id"` 19 | } `json:"type"` 20 | Damage string `json:"damage"` 21 | Dps string `json:"dps"` 22 | DamageHTML string `json:"damageHtml"` 23 | Color string `json:"color"` 24 | IsSeasonRequiredToDrop bool `json:"isSeasonRequiredToDrop"` 25 | SeasonRequiredToDrop int `json:"seasonRequiredToDrop"` 26 | Slots []string `json:"slots"` 27 | Attributes struct { 28 | Primary []struct { 29 | TextHTML string `json:"textHtml"` 30 | Text string `json:"text"` 31 | } `json:"primary"` 32 | Secondary []struct { 33 | TextHTML string `json:"textHtml"` 34 | Text string `json:"text"` 35 | } `json:"secondary"` 36 | Other []interface{} `json:"other"` 37 | } `json:"attributes"` 38 | RandomAffixes []struct { 39 | OneOf []struct { 40 | TextHTML string `json:"textHtml"` 41 | Text string `json:"text"` 42 | } `json:"oneOf"` 43 | } `json:"randomAffixes"` 44 | SetItems []string `json:"setItems"` 45 | } 46 | -------------------------------------------------------------------------------- /d3c/itemType.go: -------------------------------------------------------------------------------- 1 | package d3c 2 | 3 | // ItemTypeIndex structure 4 | type ItemTypeIndex []struct { 5 | ID string `json:"id"` 6 | Name string `json:"name"` 7 | Path string `json:"path"` 8 | } 9 | 10 | // ItemType structure 11 | type ItemType []struct { 12 | ID string `json:"id"` 13 | Slug string `json:"slug"` 14 | Name string `json:"name"` 15 | Icon string `json:"icon"` 16 | Path string `json:"path"` 17 | } 18 | -------------------------------------------------------------------------------- /d3gd/d3gd.go: -------------------------------------------------------------------------------- 1 | // Package d3gd contains types for the Diablo 3 Game Data APIs 2 | package d3gd 3 | -------------------------------------------------------------------------------- /errors.go: -------------------------------------------------------------------------------- 1 | package blizzard 2 | 3 | import "errors" 4 | 5 | // Sentinel errors 6 | var ( 7 | ErrUnknownLocale = errors.New("unknown locale") 8 | ErrInvalidLocaleForRegion = errors.New("locale is not valid for region") 9 | ) 10 | -------------------------------------------------------------------------------- /examples/search/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "fmt" 7 | "log" 8 | "net/http" 9 | "os" 10 | 11 | "github.com/FuzzyStatic/blizzard/v3" 12 | "github.com/FuzzyStatic/blizzard/v3/wowsearch" 13 | ) 14 | 15 | var ( 16 | clientID string 17 | clientSecret string 18 | ) 19 | 20 | func init() { 21 | clientID = os.Getenv("CLIENT_ID") 22 | if clientID == "" { 23 | log.Fatal("Set the environment variable CLIENT_ID before retrying.") 24 | } 25 | 26 | clientSecret = os.Getenv("CLIENT_SECRET") 27 | if clientSecret == "" { 28 | log.Fatal("Set the environment variable CLIENT_SECRET before retrying.") 29 | } 30 | } 31 | 32 | func main() { 33 | usBlizzClient, err := blizzard.NewClient(blizzard.Config{ 34 | ClientID: clientID, 35 | ClientSecret: clientSecret, 36 | HTTPClient: http.DefaultClient, 37 | Region: blizzard.US, 38 | Locale: blizzard.EnUS, 39 | }) 40 | if err != nil { 41 | panic(err) 42 | } 43 | 44 | realmSearch, _, err := usBlizzClient.ClassicWoWRealmSearch( 45 | context.TODO(), 46 | wowsearch.Page(1), 47 | wowsearch.PageSize(5), 48 | wowsearch.OrderBy("name.EN_US:asc"), 49 | wowsearch.Field(). 50 | AND("timezone", "Europe/Paris"). 51 | AND("data.locale", "enGB"). 52 | NOT("type.type", "PVP"). 53 | NOT("id", "4756||4757"). 54 | OR("type.type", "NORMAL", "RP"), 55 | ) 56 | if err != nil { 57 | panic(err) 58 | } 59 | 60 | out, err := json.MarshalIndent(realmSearch, "", " ") 61 | if err != nil { 62 | panic(err) 63 | } 64 | 65 | fmt.Println(string(out[:])) 66 | } 67 | -------------------------------------------------------------------------------- /examples/simpleClient/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "log" 6 | "net/http" 7 | "os" 8 | 9 | "github.com/FuzzyStatic/blizzard/v3" 10 | ) 11 | 12 | var ( 13 | clientID string 14 | clientSecret string 15 | ) 16 | 17 | func init() { 18 | clientID = os.Getenv("CLIENT_ID") 19 | if clientID == "" { 20 | log.Fatal("Set the environment variable CLIENT_ID before retrying.") 21 | } 22 | 23 | clientSecret = os.Getenv("CLIENT_SECRET") 24 | if clientSecret == "" { 25 | log.Fatal("Set the environment variable CLIENT_SECRET before retrying.") 26 | } 27 | } 28 | 29 | func main() { 30 | usBlizzClient, err := blizzard.NewClient(blizzard.Config{ 31 | ClientID: clientID, 32 | ClientSecret: clientSecret, 33 | HTTPClient: http.DefaultClient, 34 | Region: blizzard.US, 35 | Locale: blizzard.EnUS, 36 | }) 37 | if err != nil { 38 | panic(err) 39 | } 40 | 41 | err = usBlizzClient.AccessTokenRequest(context.Background()) 42 | if err != nil { 43 | panic(err) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/FuzzyStatic/blizzard/v3 2 | 3 | go 1.20 4 | 5 | require ( 6 | github.com/go-playground/validator/v10 v10.11.2 7 | golang.org/x/oauth2 v0.5.0 8 | ) 9 | 10 | require ( 11 | github.com/go-playground/locales v0.14.1 // indirect 12 | github.com/go-playground/universal-translator v0.18.1 // indirect 13 | github.com/golang/protobuf v1.5.2 // indirect 14 | github.com/leodido/go-urn v1.2.1 // indirect 15 | golang.org/x/crypto v0.36.0 // indirect 16 | golang.org/x/net v0.38.0 // indirect 17 | golang.org/x/sys v0.31.0 // indirect 18 | golang.org/x/text v0.23.0 // indirect 19 | google.golang.org/appengine v1.6.7 // indirect 20 | google.golang.org/protobuf v1.33.0 // indirect 21 | ) 22 | -------------------------------------------------------------------------------- /hsgd/cardBacks.go: -------------------------------------------------------------------------------- 1 | package hsgd 2 | 3 | // CardBackSearchAllLocales structure 4 | type CardBackSearchAllLocales struct { 5 | CardBacks []struct { 6 | ID int `json:"id"` 7 | SortCategory int `json:"sortCategory"` 8 | Text struct { 9 | DeDE string `json:"de_DE"` 10 | EnUS string `json:"en_US"` 11 | EsES string `json:"es_ES"` 12 | EsMX string `json:"es_MX"` 13 | FrFR string `json:"fr_FR"` 14 | ItIT string `json:"it_IT"` 15 | JaJP string `json:"ja_JP"` 16 | KoKR string `json:"ko_KR"` 17 | PlPL string `json:"pl_PL"` 18 | PtBR string `json:"pt_BR"` 19 | RuRU string `json:"ru_RU"` 20 | ThTH string `json:"th_TH"` 21 | ZhCN string `json:"zh_CN"` 22 | ZhTW string `json:"zh_TW"` 23 | } `json:"text"` 24 | Name struct { 25 | DeDE string `json:"de_DE"` 26 | EnUS string `json:"en_US"` 27 | EsES string `json:"es_ES"` 28 | EsMX string `json:"es_MX"` 29 | FrFR string `json:"fr_FR"` 30 | ItIT string `json:"it_IT"` 31 | JaJP string `json:"ja_JP"` 32 | KoKR string `json:"ko_KR"` 33 | PlPL string `json:"pl_PL"` 34 | PtBR string `json:"pt_BR"` 35 | RuRU string `json:"ru_RU"` 36 | ThTH string `json:"th_TH"` 37 | ZhCN string `json:"zh_CN"` 38 | ZhTW string `json:"zh_TW"` 39 | } `json:"name"` 40 | Image string `json:"image"` 41 | Slug string `json:"slug"` 42 | } `json:"cardBacks"` 43 | CardCount int `json:"cardCount"` 44 | PageCount int `json:"pageCount"` 45 | Page int `json:"page"` 46 | } 47 | 48 | // CardBackSearch structure 49 | type CardBackSearch struct { 50 | CardBacks []CardBack `json:"cardBacks"` 51 | CardCount int `json:"cardCount"` 52 | PageCount int `json:"pageCount"` 53 | Page int `json:"page"` 54 | } 55 | 56 | // CardBack structure 57 | type CardBack struct { 58 | ID int `json:"id"` 59 | SortCategory int `json:"sortCategory"` 60 | Text string `json:"text"` 61 | Name string `json:"name"` 62 | Image string `json:"image"` 63 | Slug string `json:"slug"` 64 | } 65 | -------------------------------------------------------------------------------- /hsgd/cardSearch.go: -------------------------------------------------------------------------------- 1 | package hsgd 2 | 3 | // Card structure 4 | type Card struct { 5 | ID int `json:"id"` 6 | Collectible int `json:"collectible"` 7 | Slug string `json:"slug"` 8 | ClassID int `json:"classId"` 9 | MultiClassIds []int `json:"multiClassIds"` 10 | CardTypeID int `json:"cardTypeId"` 11 | CardSetID int `json:"cardSetId"` 12 | RarityID int `json:"rarityId"` 13 | ArtistName string `json:"artistName"` 14 | Health int `json:"health"` 15 | Attack int `json:"attack"` 16 | ManaCost int `json:"manaCost"` 17 | Name string `json:"name"` 18 | Text string `json:"text"` 19 | Image string `json:"image"` 20 | ImageGold string `json:"imageGold"` 21 | FlavorText string `json:"flavorText"` 22 | CropImage string `json:"cropImage"` 23 | ChildIds []int `json:"childIds"` 24 | KeywordIds []int `json:"keywordIds"` 25 | Battlegrounds struct { 26 | Tier int `json:"tier"` 27 | Hero bool `json:"hero"` 28 | UpgradeID int `json:"upgradeId"` 29 | Image string `json:"image"` 30 | ImageGold string `json:"imageGold"` 31 | } `json:"battlegrounds,omitempty"` 32 | } 33 | 34 | // CardSearch structure 35 | type CardSearch struct { 36 | Cards []Card `json:"cards"` 37 | CardCount int `json:"cardCount"` 38 | PageCount int `json:"pageCount"` 39 | Page int `json:"page"` 40 | } 41 | -------------------------------------------------------------------------------- /init_test.go: -------------------------------------------------------------------------------- 1 | package blizzard 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "log" 7 | "net/http" 8 | "os" 9 | ) 10 | 11 | var ( 12 | usClient *Client 13 | printOutput string 14 | ) 15 | 16 | func init() { 17 | var err error 18 | clientID := os.Getenv("CLIENT_ID") 19 | if clientID == "" { 20 | log.Fatal("Set the environment variable CLIENT_ID before retrying.") 21 | } 22 | 23 | clientSecret := os.Getenv("CLIENT_SECRET") 24 | if clientSecret == "" { 25 | log.Fatal("Set the environment variable CLIENT_SECRET before retrying.") 26 | } 27 | 28 | printOutput = os.Getenv("PRINT_OUTPUT") 29 | if printOutput == "" { 30 | log.Println("Output will not be printed for tests.") 31 | } 32 | 33 | usClient, err = NewClient(Config{ 34 | ClientID: clientID, 35 | ClientSecret: clientSecret, 36 | HTTPClient: http.DefaultClient, 37 | Region: US, 38 | Locale: EnUS, 39 | }) 40 | if err != nil { 41 | fmt.Println(err) 42 | return 43 | } 44 | 45 | err = usClient.AccessTokenRequest(context.Background()) 46 | if err != nil { 47 | fmt.Println(err) 48 | return 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /oauth/oauth.go: -------------------------------------------------------------------------------- 1 | // Package oauth contains types for the OAuth APIs 2 | package oauth 3 | 4 | // Profile type 5 | type Profile string 6 | 7 | // PRofile field authorize scopes 8 | const ( 9 | ProfileD3 Profile = "d3.profile" 10 | ProfileSC2 Profile = "sc2.profile" 11 | ProfileWoW Profile = "wow.profile" 12 | ) 13 | -------------------------------------------------------------------------------- /oauth/tokenValidation.go: -------------------------------------------------------------------------------- 1 | package oauth 2 | 3 | // TokenValidation contains token validation data 4 | type TokenValidation struct { 5 | Exp int `json:"exp"` 6 | Username string `json:"user_name"` 7 | Authorities []string `json:"authorities"` 8 | ClientID string `json:"client_id"` 9 | Scope []string `json:"scope"` 10 | } 11 | -------------------------------------------------------------------------------- /oauth/userAuthentication.go: -------------------------------------------------------------------------------- 1 | package oauth 2 | 3 | // UserInfo structure 4 | type UserInfo struct { 5 | Sub string `json:"sub"` 6 | ID int `json:"id"` 7 | Battletag string `json:"battletag"` 8 | } 9 | -------------------------------------------------------------------------------- /oauth_test.go: -------------------------------------------------------------------------------- 1 | package blizzard 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "testing" 7 | ) 8 | 9 | func TestAccessTokenRequest(t *testing.T) { 10 | err := usClient.AccessTokenRequest(context.Background()) 11 | if err != nil { 12 | fmt.Println(err) 13 | t.Fail() 14 | } 15 | 16 | if printOutput != "" { 17 | fmt.Printf("%+v\n", usClient.oauth) 18 | } 19 | } 20 | 21 | // func TestUserInfoHeader(t *testing.T) { 22 | // err := usClient.Token() 23 | // if err != nil { 24 | // fmt.Println(err) 25 | // t.Fail() 26 | // } 27 | 28 | // dat, _, err := usClient.UserInfoHeader(usClient.oauth.Token) 29 | // if err != nil { 30 | // fmt.Println(err) 31 | // t.Fail() 32 | // } 33 | 34 | // if printOutput != "" { 35 | // fmt.Printf("%+v\n", dat) 36 | // } 37 | // } 38 | 39 | func TestTokenValidation(t *testing.T) { 40 | dat, _, err := usClient.TokenValidation(context.Background(), usClient.oauth.Token) 41 | if err != nil { 42 | fmt.Println(err) 43 | t.Fail() 44 | } 45 | 46 | if printOutput != "" { 47 | fmt.Printf("%+v\n", dat) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /owl/summaryData.go: -------------------------------------------------------------------------------- 1 | package owl 2 | 3 | // SummaryData structure 4 | type SummaryData struct { 5 | Players []Player `json:"players"` 6 | Teams []Team `json:"teams"` 7 | } 8 | 9 | // Player structure 10 | type Player struct { 11 | Number int `json:"number"` 12 | PreferredSlot int `json:"preferredSlot"` 13 | GivenName string `json:"givenName"` 14 | Teams []struct { 15 | ID interface{} `json:"id"` 16 | EarliestMatch int64 `json:"earliestMatch,omitempty"` 17 | Stats Stats `json:"stats,omitempty"` 18 | Heroes Heroes `json:"heroes,omitempty"` 19 | } `json:"teams"` 20 | Name string `json:"name"` 21 | FamilyName string `json:"familyName"` 22 | Competitions []string `json:"competitions"` 23 | Role string `json:"role"` 24 | ID int `json:"id"` 25 | HeadshotURL string `json:"headshotUrl"` 26 | AlternateIds []struct { 27 | Competitions []string `json:"competitions"` 28 | ID int `json:"id"` 29 | } `json:"alternateIds"` 30 | CurrentTeam int `json:"currentTeam"` 31 | } 32 | 33 | type Team struct { 34 | ID int `json:"id"` 35 | Competitions []string `json:"competitions"` 36 | Name string `json:"name"` 37 | Roster []int `json:"roster"` 38 | Code string `json:"code"` 39 | AlternateIds []struct { 40 | Competitions []string `json:"competitions"` 41 | ID int `json:"id"` 42 | } `json:"alternateIds"` 43 | Logo string `json:"logo"` 44 | Icon string `json:"icon"` 45 | PrimaryColor string `json:"primaryColor"` 46 | SecondaryColor string `json:"secondaryColor"` 47 | } 48 | -------------------------------------------------------------------------------- /owl_test.go: -------------------------------------------------------------------------------- 1 | package blizzard 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "testing" 7 | ) 8 | 9 | func TestOWLSummaryData(t *testing.T) { 10 | dat, _, err := usClient.OWLSummaryData(context.Background()) 11 | if err != nil { 12 | fmt.Println(err) 13 | t.Fail() 14 | } 15 | 16 | if printOutput != "" { 17 | fmt.Printf("%+v\n", dat) 18 | } 19 | } 20 | 21 | func TestOWLPlayersAPI(t *testing.T) { 22 | dat, _, err := usClient.OWLPlayersAPI(context.Background(), 15401) 23 | if err != nil { 24 | fmt.Println(err) 25 | t.Fail() 26 | } 27 | 28 | if printOutput != "" { 29 | fmt.Printf("%+v\n", dat) 30 | } 31 | } 32 | 33 | func TestOWLMatchesAPI(t *testing.T) { 34 | dat, _, err := usClient.OWLMatchesAPI(context.Background(), 38971) 35 | if err != nil { 36 | fmt.Println(err) 37 | t.Fail() 38 | } 39 | 40 | if printOutput != "" { 41 | fmt.Printf("%+v\n", dat) 42 | } 43 | } 44 | 45 | func TestOWLSegmentsAPI(t *testing.T) { 46 | dat, _, err := usClient.OWLSegmentsAPI(context.Background(), "owl2-2022-kickoff-clash-qualifiers") 47 | if err != nil { 48 | fmt.Println(err) 49 | t.Fail() 50 | } 51 | 52 | if printOutput != "" { 53 | fmt.Printf("%+v\n", dat) 54 | } 55 | } 56 | 57 | func TestOWLTeamsAPI(t *testing.T) { 58 | dat, _, err := usClient.OWLTeamsAPI(context.Background(), 15170) 59 | if err != nil { 60 | fmt.Println(err) 61 | t.Fail() 62 | } 63 | 64 | if printOutput != "" { 65 | fmt.Printf("%+v\n", dat) 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /region_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=Region -linecomment"; DO NOT EDIT. 2 | 3 | package blizzard 4 | 5 | import "strconv" 6 | 7 | func _() { 8 | // An "invalid array index" compiler error signifies that the constant values have changed. 9 | // Re-run the stringer command to generate them again. 10 | var x [1]struct{} 11 | _ = x[US-1] 12 | _ = x[EU-2] 13 | _ = x[KR-3] 14 | _ = x[TW-4] 15 | _ = x[CN-5] 16 | } 17 | 18 | const _Region_name = "useukrtwcn" 19 | 20 | var _Region_index = [...]uint8{0, 2, 4, 6, 8, 10} 21 | 22 | func (i Region) String() string { 23 | i -= 1 24 | if i < 0 || i >= Region(len(_Region_index)-1) { 25 | return "Region(" + strconv.FormatInt(int64(i+1), 10) + ")" 26 | } 27 | return _Region_name[_Region_index[i]:_Region_index[i+1]] 28 | } 29 | -------------------------------------------------------------------------------- /sc2c/account.go: -------------------------------------------------------------------------------- 1 | package sc2c 2 | 3 | // Player structure 4 | type Player []struct { 5 | Name string `json:"name"` 6 | ProfileURL string `json:"profileUrl"` 7 | AvatarURL string `json:"avatarUrl"` 8 | ProfileID string `json:"profileId"` 9 | RegionID int `json:"regionId"` 10 | RealmID int `json:"realmId"` 11 | } 12 | -------------------------------------------------------------------------------- /sc2c/ladder.go: -------------------------------------------------------------------------------- 1 | package sc2c 2 | 3 | // LadderGrandmaster structure 4 | type LadderGrandmaster struct { 5 | LadderTeams []struct { 6 | TeamMembers []struct { 7 | ID string `json:"id"` 8 | Realm int `json:"realm"` 9 | Region int `json:"region"` 10 | DisplayName string `json:"displayName"` 11 | ClanTag string `json:"clanTag"` 12 | FavoriteRace string `json:"favoriteRace"` 13 | } `json:"teamMembers"` 14 | PreviousRank int `json:"previousRank"` 15 | Points int `json:"points"` 16 | Wins int `json:"wins"` 17 | Losses int `json:"losses"` 18 | Mmr int `json:"mmr"` 19 | JoinTimestamp int `json:"joinTimestamp"` 20 | } `json:"ladderTeams"` 21 | } 22 | 23 | // LadderSeason structure 24 | type LadderSeason struct { 25 | SeasonID int `json:"seasonId"` 26 | Number int `json:"number"` 27 | Year int `json:"year"` 28 | StartDate string `json:"startDate"` 29 | EndDate string `json:"endDate"` 30 | } 31 | -------------------------------------------------------------------------------- /sc2c/sc2c.go: -------------------------------------------------------------------------------- 1 | // Package sc2c contains types for the Starcraft 2 Community APIs 2 | package sc2c 3 | -------------------------------------------------------------------------------- /sc2gd.go: -------------------------------------------------------------------------------- 1 | package blizzard 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/FuzzyStatic/blizzard/v3/sc2gd" 8 | ) 9 | 10 | // SC2LeagueData returns all SC2 league data from for seasonID, queue ID, team type, and league ID 11 | func (c *Client) SC2LeagueData(ctx context.Context, seasonID int, 12 | queueID sc2gd.QueueID, teamType sc2gd.TeamType, leagueID sc2gd.LeagueID) (*sc2gd.League, *Header, error) { 13 | dat, header, err := c.getStructDataNoNamespace(ctx, 14 | fmt.Sprintf("/data/sc2/league/%d/%d/%d/%d", seasonID, queueID, teamType, leagueID), 15 | &sc2gd.League{}, 16 | ) 17 | return dat.(*sc2gd.League), header, err 18 | } 19 | 20 | // SC2LadderData returns SC2 ladder for given division's ladderID. 21 | // This API is undocumented by Blizzard, so it may be unstable. 22 | func (c *Client) SC2LadderData(ctx context.Context, ladderID int) (*sc2gd.Ladder, *Header, error) { 23 | dat, header, err := c.getStructDataNoNamespace(ctx, 24 | fmt.Sprintf("/data/sc2/ladder/%d", ladderID), 25 | &sc2gd.Ladder{}, 26 | ) 27 | return dat.(*sc2gd.Ladder), header, err 28 | } 29 | -------------------------------------------------------------------------------- /sc2gd/ladder.go: -------------------------------------------------------------------------------- 1 | package sc2gd 2 | 3 | // Ladder structure 4 | type Ladder struct { 5 | Team []struct { 6 | ID uint64 `json:"id"` 7 | Rating int `json:"rating"` 8 | Wins int `json:"wins"` 9 | Losses int `json:"losses"` 10 | Ties int `json:"ties"` 11 | Points int `json:"points"` 12 | LongestWinStreak int `json:"longest_win_streak"` 13 | CurrentWinStreak int `json:"current_win_streak"` 14 | CurrentRank int `json:"current_rank"` 15 | HighestRank int `json:"highest_rank"` 16 | PreviousRank int `json:"previous_rank"` 17 | JoinTimeStamp int `json:"join_time_stamp"` 18 | LastPlayedTimeStamp int `json:"last_played_time_stamp"` 19 | Member []struct { 20 | LegacyLink struct { 21 | ID int `json:"id"` 22 | Realm int `json:"realm"` 23 | Name string `json:"name"` 24 | Path string `json:"path"` 25 | } `json:"legacy_link"` 26 | PlayedRaceCount []struct { 27 | Race string `json:"race"` 28 | Count int `json:"count"` 29 | } `json:"played_race_count"` 30 | CharacterLink struct { 31 | ID int `json:"id"` 32 | BattleTag string `json:"battle_tag"` 33 | Key struct { 34 | Href string `json:"href"` 35 | } `json:"key"` 36 | } `json:"character_link"` 37 | ClanLink struct { 38 | ID int `json:"id"` 39 | ClanTag string `json:"clan_tag"` 40 | ClanName string `json:"clan_name"` 41 | IconURL string `json:"icon_url"` 42 | DecalURL string `json:"decal_url"` 43 | } `json:"clan_link"` 44 | } `json:"member"` 45 | } `json:"team"` 46 | } 47 | -------------------------------------------------------------------------------- /sc2gd/league.go: -------------------------------------------------------------------------------- 1 | package sc2gd 2 | 3 | // QueueID IDs for different league queues 4 | type QueueID int 5 | 6 | // QueueID constants (1=WoL 1v1, 2=WoL 2v2, 3=WoL 3v3, 4=WoL 4v4) DO NOT REARRANGE 7 | const ( 8 | _ QueueID = iota 9 | WoL1v1 10 | WoL2v2 11 | WoL3v3 12 | WoL4v4 13 | ) 14 | 15 | // QueueID constants (101=HotS 1v1, 102=HotS 2v2, 103=HotS 3v3, 104=HotS 4v4) DO NOT REARRANGE 16 | const ( 17 | _ QueueID = 100 + iota 18 | HotS1v1 19 | HotS2v2 20 | HotS3v3 21 | HotS4v4 22 | ) 23 | 24 | // QueueID constants (201=LotV 1v1, 202=LotV 2v2, 203=LotV 3v3, 204=LotV 4v4, 206=LotV Archon) DO NOT REARRANGE 25 | const ( 26 | _ QueueID = 200 + iota 27 | LotV1v1 28 | LotV2v2 29 | LotV3v3 30 | LotV4v4 31 | _ 32 | LotVArchon 33 | ) 34 | 35 | // TeamType different team types 36 | type TeamType int 37 | 38 | // TeamType constants (0=arranged, 1=random) DO NOT REARRANGE 39 | const ( 40 | Arranged TeamType = iota 41 | Random 42 | ) 43 | 44 | // LeagueID available leagues 45 | type LeagueID int 46 | 47 | // LeagueID constants ( 0=Bronze, 1=Silver, 2=Gold, 3=Platinum, 4=Diamond, 5=Master, 6=Grandmaster) DO NOT REARRANGE 48 | const ( 49 | Bronze LeagueID = iota 50 | Silver 51 | Gold 52 | Platinum 53 | Diamond 54 | Master 55 | Grandmaster 56 | ) 57 | 58 | // League structure 59 | type League struct { 60 | Links struct { 61 | Self struct { 62 | Href string `json:"href"` 63 | } `json:"self"` 64 | } `json:"_links"` 65 | Key struct { 66 | LeagueID int `json:"league_id"` 67 | SeasonID int `json:"season_id"` 68 | QueueID int `json:"queue_id"` 69 | TeamType int `json:"team_type"` 70 | } `json:"key"` 71 | Tier []struct { 72 | ID int `json:"id"` 73 | MinRating int `json:"min_rating"` 74 | MaxRating int `json:"max_rating"` 75 | Division []struct { 76 | ID int `json:"id"` 77 | LadderID int `json:"ladder_id"` 78 | MemberCount int `json:"member_count"` 79 | } `json:"division"` 80 | } `json:"tier"` 81 | } 82 | -------------------------------------------------------------------------------- /sc2gd/sc2gd.go: -------------------------------------------------------------------------------- 1 | // Package sc2gd contains types for the Starcraft 2 Game Data APIs 2 | package sc2gd 3 | -------------------------------------------------------------------------------- /sc2gd_test.go: -------------------------------------------------------------------------------- 1 | package blizzard 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "testing" 7 | 8 | "github.com/FuzzyStatic/blizzard/v3/sc2gd" 9 | ) 10 | 11 | func TestSC2LeagueData(t *testing.T) { 12 | dat, _, err := usClient.SC2LeagueData(context.Background(), 37, sc2gd.LotV1v1, sc2gd.Arranged, sc2gd.Master) 13 | if err != nil { 14 | fmt.Println(err) 15 | t.Fail() 16 | } 17 | 18 | if printOutput != "" { 19 | fmt.Printf("%+v\n", dat) 20 | } 21 | } 22 | 23 | func TestSC2LadderData(t *testing.T) { 24 | dat, _, err := usClient.SC2LadderData(context.Background(), 292787) 25 | if err != nil { 26 | fmt.Println(err) 27 | t.Fail() 28 | } 29 | 30 | if printOutput != "" { 31 | fmt.Printf("%+v\n", dat) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/go-playground/locales/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-playground/locales/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.13.1 4 | - tip 5 | matrix: 6 | allow_failures: 7 | - go: tip 8 | 9 | notifications: 10 | email: 11 | recipients: dean.karn@gmail.com 12 | on_success: change 13 | on_failure: always 14 | 15 | before_install: 16 | - go install github.com/mattn/goveralls 17 | 18 | # Only clone the most recent commit. 19 | git: 20 | depth: 1 21 | 22 | script: 23 | - go test -v -race -covermode=atomic -coverprofile=coverage.coverprofile ./... 24 | 25 | after_success: | 26 | goveralls -coverprofile=coverage.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN -------------------------------------------------------------------------------- /vendor/github.com/go-playground/locales/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Go Playground 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/go-playground/locales/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuzzyStatic/blizzard/fd2d54fdb2712737274f3848084ff41a4e71ba1d/vendor/github.com/go-playground/locales/logo.png -------------------------------------------------------------------------------- /vendor/github.com/go-playground/universal-translator/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | *.coverprofile -------------------------------------------------------------------------------- /vendor/github.com/go-playground/universal-translator/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.13.4 4 | - tip 5 | matrix: 6 | allow_failures: 7 | - go: tip 8 | 9 | notifications: 10 | email: 11 | recipients: dean.karn@gmail.com 12 | on_success: change 13 | on_failure: always 14 | 15 | before_install: 16 | - go install github.com/mattn/goveralls 17 | 18 | # Only clone the most recent commit. 19 | git: 20 | depth: 1 21 | 22 | script: 23 | - go test -v -race -covermode=atomic -coverprofile=coverage.coverprofile ./... 24 | 25 | after_success: | 26 | [ $TRAVIS_GO_VERSION = 1.13.4 ] && 27 | goveralls -coverprofile=coverage.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN -------------------------------------------------------------------------------- /vendor/github.com/go-playground/universal-translator/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Go Playground 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-playground/universal-translator/Makefile: -------------------------------------------------------------------------------- 1 | GOCMD=GO111MODULE=on go 2 | 3 | linters-install: 4 | @golangci-lint --version >/dev/null 2>&1 || { \ 5 | echo "installing linting tools..."; \ 6 | curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.41.1; \ 7 | } 8 | 9 | lint: linters-install 10 | golangci-lint run 11 | 12 | test: 13 | $(GOCMD) test -cover -race ./... 14 | 15 | bench: 16 | $(GOCMD) test -bench=. -benchmem ./... 17 | 18 | .PHONY: test lint linters-install -------------------------------------------------------------------------------- /vendor/github.com/go-playground/universal-translator/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuzzyStatic/blizzard/fd2d54fdb2712737274f3848084ff41a4e71ba1d/vendor/github.com/go-playground/universal-translator/logo.png -------------------------------------------------------------------------------- /vendor/github.com/go-playground/validator/v10/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | bin 10 | 11 | # Architecture specific extensions/prefixes 12 | *.[568vq] 13 | [568vq].out 14 | 15 | *.cgo1.go 16 | *.cgo2.c 17 | _cgo_defun.c 18 | _cgo_gotypes.go 19 | _cgo_export.* 20 | 21 | _testmain.go 22 | 23 | *.exe 24 | *.test 25 | *.prof 26 | *.test 27 | *.out 28 | *.txt 29 | cover.html 30 | README.html 31 | .idea 32 | -------------------------------------------------------------------------------- /vendor/github.com/go-playground/validator/v10/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Dean Karn 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-playground/validator/v10/MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | ## Maintainers Guide 2 | 3 | ### Semantic Versioning 4 | Semantic versioning as defined [here](https://semver.org) must be strictly adhered to. 5 | 6 | ### External Dependencies 7 | Any new external dependencies MUST: 8 | - Have a compatible LICENSE present. 9 | - Be actively maintained. 10 | - Be approved by @go-playground/admins 11 | 12 | ### PR Merge Requirements 13 | - Up-to-date branch. 14 | - Passing tests and linting. 15 | - CODEOWNERS approval. 16 | - Tests that cover both the Happy and Unhappy paths. -------------------------------------------------------------------------------- /vendor/github.com/go-playground/validator/v10/Makefile: -------------------------------------------------------------------------------- 1 | GOCMD=GO111MODULE=on go 2 | 3 | linters-install: 4 | @golangci-lint --version >/dev/null 2>&1 || { \ 5 | echo "installing linting tools..."; \ 6 | curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.41.1; \ 7 | } 8 | 9 | lint: linters-install 10 | golangci-lint run 11 | 12 | test: 13 | $(GOCMD) test -cover -race ./... 14 | 15 | bench: 16 | $(GOCMD) test -bench=. -benchmem ./... 17 | 18 | .PHONY: test lint linters-install -------------------------------------------------------------------------------- /vendor/github.com/go-playground/validator/v10/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuzzyStatic/blizzard/fd2d54fdb2712737274f3848084ff41a4e71ba1d/vendor/github.com/go-playground/validator/v10/logo.png -------------------------------------------------------------------------------- /vendor/github.com/go-playground/validator/v10/translations.go: -------------------------------------------------------------------------------- 1 | package validator 2 | 3 | import ut "github.com/go-playground/universal-translator" 4 | 5 | // TranslationFunc is the function type used to register or override 6 | // custom translations 7 | type TranslationFunc func(ut ut.Translator, fe FieldError) string 8 | 9 | // RegisterTranslationsFunc allows for registering of translations 10 | // for a 'ut.Translator' for use within the 'TranslationFunc' 11 | type RegisterTranslationsFunc func(ut ut.Translator) error 12 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2010 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/proto/defaults.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | import ( 8 | "google.golang.org/protobuf/reflect/protoreflect" 9 | ) 10 | 11 | // SetDefaults sets unpopulated scalar fields to their default values. 12 | // Fields within a oneof are not set even if they have a default value. 13 | // SetDefaults is recursively called upon any populated message fields. 14 | func SetDefaults(m Message) { 15 | if m != nil { 16 | setDefaults(MessageReflect(m)) 17 | } 18 | } 19 | 20 | func setDefaults(m protoreflect.Message) { 21 | fds := m.Descriptor().Fields() 22 | for i := 0; i < fds.Len(); i++ { 23 | fd := fds.Get(i) 24 | if !m.Has(fd) { 25 | if fd.HasDefault() && fd.ContainingOneof() == nil { 26 | v := fd.Default() 27 | if fd.Kind() == protoreflect.BytesKind { 28 | v = protoreflect.ValueOf(append([]byte(nil), v.Bytes()...)) // copy the default bytes 29 | } 30 | m.Set(fd, v) 31 | } 32 | continue 33 | } 34 | } 35 | 36 | m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { 37 | switch { 38 | // Handle singular message. 39 | case fd.Cardinality() != protoreflect.Repeated: 40 | if fd.Message() != nil { 41 | setDefaults(m.Get(fd).Message()) 42 | } 43 | // Handle list of messages. 44 | case fd.IsList(): 45 | if fd.Message() != nil { 46 | ls := m.Get(fd).List() 47 | for i := 0; i < ls.Len(); i++ { 48 | setDefaults(ls.Get(i).Message()) 49 | } 50 | } 51 | // Handle map of messages. 52 | case fd.IsMap(): 53 | if fd.MapValue().Message() != nil { 54 | ms := m.Get(fd).Map() 55 | ms.Range(func(_ protoreflect.MapKey, v protoreflect.Value) bool { 56 | setDefaults(v.Message()) 57 | return true 58 | }) 59 | } 60 | } 61 | return true 62 | }) 63 | } 64 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/proto/discard.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | import ( 8 | "google.golang.org/protobuf/reflect/protoreflect" 9 | ) 10 | 11 | // DiscardUnknown recursively discards all unknown fields from this message 12 | // and all embedded messages. 13 | // 14 | // When unmarshaling a message with unrecognized fields, the tags and values 15 | // of such fields are preserved in the Message. This allows a later call to 16 | // marshal to be able to produce a message that continues to have those 17 | // unrecognized fields. To avoid this, DiscardUnknown is used to 18 | // explicitly clear the unknown fields after unmarshaling. 19 | func DiscardUnknown(m Message) { 20 | if m != nil { 21 | discardUnknown(MessageReflect(m)) 22 | } 23 | } 24 | 25 | func discardUnknown(m protoreflect.Message) { 26 | m.Range(func(fd protoreflect.FieldDescriptor, val protoreflect.Value) bool { 27 | switch { 28 | // Handle singular message. 29 | case fd.Cardinality() != protoreflect.Repeated: 30 | if fd.Message() != nil { 31 | discardUnknown(m.Get(fd).Message()) 32 | } 33 | // Handle list of messages. 34 | case fd.IsList(): 35 | if fd.Message() != nil { 36 | ls := m.Get(fd).List() 37 | for i := 0; i < ls.Len(); i++ { 38 | discardUnknown(ls.Get(i).Message()) 39 | } 40 | } 41 | // Handle map of messages. 42 | case fd.IsMap(): 43 | if fd.MapValue().Message() != nil { 44 | ms := m.Get(fd).Map() 45 | ms.Range(func(_ protoreflect.MapKey, v protoreflect.Value) bool { 46 | discardUnknown(v.Message()) 47 | return true 48 | }) 49 | } 50 | } 51 | return true 52 | }) 53 | 54 | // Discard unknown fields. 55 | if len(m.GetUnknown()) > 0 { 56 | m.SetUnknown(nil) 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/proto/wrappers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | // Bool stores v in a new bool value and returns a pointer to it. 8 | func Bool(v bool) *bool { return &v } 9 | 10 | // Int stores v in a new int32 value and returns a pointer to it. 11 | // 12 | // Deprecated: Use Int32 instead. 13 | func Int(v int) *int32 { return Int32(int32(v)) } 14 | 15 | // Int32 stores v in a new int32 value and returns a pointer to it. 16 | func Int32(v int32) *int32 { return &v } 17 | 18 | // Int64 stores v in a new int64 value and returns a pointer to it. 19 | func Int64(v int64) *int64 { return &v } 20 | 21 | // Uint32 stores v in a new uint32 value and returns a pointer to it. 22 | func Uint32(v uint32) *uint32 { return &v } 23 | 24 | // Uint64 stores v in a new uint64 value and returns a pointer to it. 25 | func Uint64(v uint64) *uint64 { return &v } 26 | 27 | // Float32 stores v in a new float32 value and returns a pointer to it. 28 | func Float32(v float32) *float32 { return &v } 29 | 30 | // Float64 stores v in a new float64 value and returns a pointer to it. 31 | func Float64(v float64) *float64 { return &v } 32 | 33 | // String stores v in a new string value and returns a pointer to it. 34 | func String(v string) *string { return &v } 35 | -------------------------------------------------------------------------------- /vendor/github.com/leodido/go-urn/.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | *.dll 3 | *.so 4 | *.dylib 5 | 6 | *.test 7 | 8 | *.out 9 | *.txt 10 | 11 | vendor/ -------------------------------------------------------------------------------- /vendor/github.com/leodido/go-urn/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.13.x 5 | - 1.14.x 6 | - 1.15.x 7 | - tip 8 | 9 | before_install: 10 | - go get -t -v ./... 11 | 12 | script: 13 | - go test -race -coverprofile=coverage.txt -covermode=atomic 14 | 15 | after_success: 16 | - bash <(curl -s https://codecov.io/bash) -------------------------------------------------------------------------------- /vendor/github.com/leodido/go-urn/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Leonardo Di Donato 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/leodido/go-urn/makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/bash 2 | 3 | build: machine.go 4 | 5 | images: docs/urn.png 6 | 7 | machine.go: machine.go.rl 8 | ragel -Z -G2 -e -o $@ $< 9 | @sed -i '/^\/\/line/d' $@ 10 | @$(MAKE) -s file=$@ snake2camel 11 | @gofmt -w -s $@ 12 | 13 | docs/urn.dot: machine.go.rl 14 | @mkdir -p docs 15 | ragel -Z -e -Vp $< -o $@ 16 | 17 | docs/urn.png: docs/urn.dot 18 | dot $< -Tpng -o $@ 19 | 20 | .PHONY: bench 21 | bench: *_test.go machine.go 22 | go test -bench=. -benchmem -benchtime=5s ./... 23 | 24 | .PHONY: tests 25 | tests: *_test.go machine.go 26 | go test -race -timeout 10s -coverprofile=coverage.out -covermode=atomic -v ./... 27 | 28 | .PHONY: clean 29 | clean: 30 | @rm -rf docs 31 | @rm -f machine.go 32 | 33 | .PHONY: snake2camel 34 | snake2camel: 35 | @awk -i inplace '{ \ 36 | while ( match($$0, /(.*)([a-z]+[0-9]*)_([a-zA-Z0-9])(.*)/, cap) ) \ 37 | $$0 = cap[1] cap[2] toupper(cap[3]) cap[4]; \ 38 | print \ 39 | }' $(file) -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009 The Go Authors. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google LLC nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/hashes_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !gc || purego || !s390x 6 | 7 | package sha3 8 | 9 | func new224() *state { 10 | return new224Generic() 11 | } 12 | 13 | func new256() *state { 14 | return new256Generic() 15 | } 16 | 17 | func new384() *state { 18 | return new384Generic() 19 | } 20 | 21 | func new512() *state { 22 | return new512Generic() 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/keccakf_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && !purego && gc 6 | 7 | package sha3 8 | 9 | // This function is implemented in keccakf_amd64.s. 10 | 11 | //go:noescape 12 | 13 | func keccakF1600(a *[25]uint64) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/sha3_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc && !purego 6 | 7 | #include "textflag.h" 8 | 9 | // func kimd(function code, chain *[200]byte, src []byte) 10 | TEXT ·kimd(SB), NOFRAME|NOSPLIT, $0-40 11 | MOVD function+0(FP), R0 12 | MOVD chain+8(FP), R1 13 | LMG src+16(FP), R2, R3 // R2=base, R3=len 14 | 15 | continue: 16 | WORD $0xB93E0002 // KIMD --, R2 17 | BVS continue // continue if interrupted 18 | MOVD $0, R0 // reset R0 for pre-go1.8 compilers 19 | RET 20 | 21 | // func klmd(function code, chain *[200]byte, dst, src []byte) 22 | TEXT ·klmd(SB), NOFRAME|NOSPLIT, $0-64 23 | // TODO: SHAKE support 24 | MOVD function+0(FP), R0 25 | MOVD chain+8(FP), R1 26 | LMG dst+16(FP), R2, R3 // R2=base, R3=len 27 | LMG src+40(FP), R4, R5 // R4=base, R5=len 28 | 29 | continue: 30 | WORD $0xB93F0024 // KLMD R2, R4 31 | BVS continue // continue if interrupted 32 | MOVD $0, R0 // reset R0 for pre-go1.8 compilers 33 | RET 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/shake_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !gc || purego || !s390x 6 | 7 | package sha3 8 | 9 | func newShake128() *state { 10 | return newShake128Generic() 11 | } 12 | 13 | func newShake256() *state { 14 | return newShake256Generic() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009 The Go Authors. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google LLC nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - tip 5 | 6 | install: 7 | - export GOPATH="$HOME/gopath" 8 | - mkdir -p "$GOPATH/src/golang.org/x" 9 | - mv "$TRAVIS_BUILD_DIR" "$GOPATH/src/golang.org/x/oauth2" 10 | - go get -v -t -d golang.org/x/oauth2/... 11 | 12 | script: 13 | - go test -v golang.org/x/oauth2/... 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | ## Filing issues 8 | 9 | When [filing an issue](https://github.com/golang/oauth2/issues), make sure to answer these five questions: 10 | 11 | 1. What version of Go are you using (`go version`)? 12 | 2. What operating system and processor architecture are you using? 13 | 3. What did you do? 14 | 4. What did you expect to see? 15 | 5. What did you see instead? 16 | 17 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 18 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 19 | 20 | ## Contributing code 21 | 22 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 23 | before sending patches. 24 | 25 | Unless otherwise noted, the Go source files are distributed under 26 | the BSD-style license found in the LICENSE file. 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/README.md: -------------------------------------------------------------------------------- 1 | # OAuth2 for Go 2 | 3 | [![Go Reference](https://pkg.go.dev/badge/golang.org/x/oauth2.svg)](https://pkg.go.dev/golang.org/x/oauth2) 4 | [![Build Status](https://travis-ci.org/golang/oauth2.svg?branch=master)](https://travis-ci.org/golang/oauth2) 5 | 6 | oauth2 package contains a client implementation for OAuth 2.0 spec. 7 | 8 | ## Installation 9 | 10 | ~~~~ 11 | go get golang.org/x/oauth2 12 | ~~~~ 13 | 14 | Or you can manually git clone the repository to 15 | `$(go env GOPATH)/src/golang.org/x/oauth2`. 16 | 17 | See pkg.go.dev for further documentation and examples. 18 | 19 | * [pkg.go.dev/golang.org/x/oauth2](https://pkg.go.dev/golang.org/x/oauth2) 20 | * [pkg.go.dev/golang.org/x/oauth2/google](https://pkg.go.dev/golang.org/x/oauth2/google) 21 | 22 | ## Policy for new packages 23 | 24 | We no longer accept new provider-specific packages in this repo if all 25 | they do is add a single endpoint variable. If you just want to add a 26 | single endpoint, add it to the 27 | [pkg.go.dev/golang.org/x/oauth2/endpoints](https://pkg.go.dev/golang.org/x/oauth2/endpoints) 28 | package. 29 | 30 | ## Report Issues / Send Patches 31 | 32 | This repository uses Gerrit for code changes. To learn how to submit changes to 33 | this repository, see https://golang.org/doc/contribute.html. 34 | 35 | The main issue tracker for the oauth2 repository is located at 36 | https://github.com/golang/oauth2/issues. 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/internal/client_appengine.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build appengine 6 | // +build appengine 7 | 8 | package internal 9 | 10 | import "google.golang.org/appengine/urlfetch" 11 | 12 | func init() { 13 | appengineClientHook = urlfetch.Client 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/internal/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package internal contains support packages for oauth2 package. 6 | package internal 7 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/internal/oauth2.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import ( 8 | "crypto/rsa" 9 | "crypto/x509" 10 | "encoding/pem" 11 | "errors" 12 | "fmt" 13 | ) 14 | 15 | // ParseKey converts the binary contents of a private key file 16 | // to an *rsa.PrivateKey. It detects whether the private key is in a 17 | // PEM container or not. If so, it extracts the the private key 18 | // from PEM container before conversion. It only supports PEM 19 | // containers with no passphrase. 20 | func ParseKey(key []byte) (*rsa.PrivateKey, error) { 21 | block, _ := pem.Decode(key) 22 | if block != nil { 23 | key = block.Bytes 24 | } 25 | parsedKey, err := x509.ParsePKCS8PrivateKey(key) 26 | if err != nil { 27 | parsedKey, err = x509.ParsePKCS1PrivateKey(key) 28 | if err != nil { 29 | return nil, fmt.Errorf("private key should be a PEM or plain PKCS1 or PKCS8; parse error: %v", err) 30 | } 31 | } 32 | parsed, ok := parsedKey.(*rsa.PrivateKey) 33 | if !ok { 34 | return nil, errors.New("private key is invalid") 35 | } 36 | return parsed, nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/internal/transport.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import ( 8 | "context" 9 | "net/http" 10 | ) 11 | 12 | // HTTPClient is the context key to use with golang.org/x/net/context's 13 | // WithValue function to associate an *http.Client value with a context. 14 | var HTTPClient ContextKey 15 | 16 | // ContextKey is just an empty struct. It exists so HTTPClient can be 17 | // an immutable public variable with a unique type. It's immutable 18 | // because nobody else can create a ContextKey, being unexported. 19 | type ContextKey struct{} 20 | 21 | var appengineClientHook func(context.Context) *http.Client 22 | 23 | func ContextClient(ctx context.Context) *http.Client { 24 | if ctx != nil { 25 | if hc, ok := ctx.Value(HTTPClient).(*http.Client); ok { 26 | return hc 27 | } 28 | } 29 | if appengineClientHook != nil { 30 | return appengineClientHook(ctx) 31 | } 32 | return http.DefaultClient 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009 The Go Authors. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google LLC nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/asm_darwin_x86_gc.s: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && amd64 && gc 6 | 7 | #include "textflag.h" 8 | 9 | TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 10 | JMP libc_sysctl(SB) 11 | GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 12 | DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) 13 | 14 | TEXT libc_sysctlbyname_trampoline<>(SB),NOSPLIT,$0-0 15 | JMP libc_sysctlbyname(SB) 16 | GLOBL ·libc_sysctlbyname_trampoline_addr(SB), RODATA, $8 17 | DATA ·libc_sysctlbyname_trampoline_addr(SB)/8, $libc_sysctlbyname_trampoline<>(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/byteorder.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | import ( 8 | "runtime" 9 | ) 10 | 11 | // byteOrder is a subset of encoding/binary.ByteOrder. 12 | type byteOrder interface { 13 | Uint32([]byte) uint32 14 | Uint64([]byte) uint64 15 | } 16 | 17 | type littleEndian struct{} 18 | type bigEndian struct{} 19 | 20 | func (littleEndian) Uint32(b []byte) uint32 { 21 | _ = b[3] // bounds check hint to compiler; see golang.org/issue/14808 22 | return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 23 | } 24 | 25 | func (littleEndian) Uint64(b []byte) uint64 { 26 | _ = b[7] // bounds check hint to compiler; see golang.org/issue/14808 27 | return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | 28 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 29 | } 30 | 31 | func (bigEndian) Uint32(b []byte) uint32 { 32 | _ = b[3] // bounds check hint to compiler; see golang.org/issue/14808 33 | return uint32(b[3]) | uint32(b[2])<<8 | uint32(b[1])<<16 | uint32(b[0])<<24 34 | } 35 | 36 | func (bigEndian) Uint64(b []byte) uint64 { 37 | _ = b[7] // bounds check hint to compiler; see golang.org/issue/14808 38 | return uint64(b[7]) | uint64(b[6])<<8 | uint64(b[5])<<16 | uint64(b[4])<<24 | 39 | uint64(b[3])<<32 | uint64(b[2])<<40 | uint64(b[1])<<48 | uint64(b[0])<<56 40 | } 41 | 42 | // hostByteOrder returns littleEndian on little-endian machines and 43 | // bigEndian on big-endian machines. 44 | func hostByteOrder() byteOrder { 45 | switch runtime.GOARCH { 46 | case "386", "amd64", "amd64p32", 47 | "alpha", 48 | "arm", "arm64", 49 | "loong64", 50 | "mipsle", "mips64le", "mips64p32le", 51 | "nios2", 52 | "ppc64le", 53 | "riscv", "riscv64", 54 | "sh": 55 | return littleEndian{} 56 | case "armbe", "arm64be", 57 | "m68k", 58 | "mips", "mips64", "mips64p32", 59 | "ppc", "ppc64", 60 | "s390", "s390x", 61 | "shbe", 62 | "sparc", "sparc64": 63 | return bigEndian{} 64 | } 65 | panic("unknown architecture") 66 | } 67 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_aix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix 6 | 7 | package cpu 8 | 9 | const ( 10 | // getsystemcfg constants 11 | _SC_IMPL = 2 12 | _IMPL_POWER8 = 0x10000 13 | _IMPL_POWER9 = 0x20000 14 | ) 15 | 16 | func archInit() { 17 | impl := getsystemcfg(_SC_IMPL) 18 | if impl&_IMPL_POWER8 != 0 { 19 | PPC64.IsPOWER8 = true 20 | } 21 | if impl&_IMPL_POWER9 != 0 { 22 | PPC64.IsPOWER8 = true 23 | PPC64.IsPOWER9 = true 24 | } 25 | 26 | Initialized = true 27 | } 28 | 29 | func getsystemcfg(label int) (n uint64) { 30 | r0, _ := callgetsystemcfg(label) 31 | n = uint64(r0) 32 | return 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // func getisar0() uint64 10 | TEXT ·getisar0(SB),NOSPLIT,$0-8 11 | // get Instruction Set Attributes 0 into x0 12 | // mrs x0, ID_AA64ISAR0_EL1 = d5380600 13 | WORD $0xd5380600 14 | MOVD R0, ret+0(FP) 15 | RET 16 | 17 | // func getisar1() uint64 18 | TEXT ·getisar1(SB),NOSPLIT,$0-8 19 | // get Instruction Set Attributes 1 into x0 20 | // mrs x0, ID_AA64ISAR1_EL1 = d5380620 21 | WORD $0xd5380620 22 | MOVD R0, ret+0(FP) 23 | RET 24 | 25 | // func getpfr0() uint64 26 | TEXT ·getpfr0(SB),NOSPLIT,$0-8 27 | // get Processor Feature Register 0 into x0 28 | // mrs x0, ID_AA64PFR0_EL1 = d5380400 29 | WORD $0xd5380400 30 | MOVD R0, ret+0(FP) 31 | RET 32 | 33 | // func getzfr0() uint64 34 | TEXT ·getzfr0(SB),NOSPLIT,$0-8 35 | // get SVE Feature Register 0 into x0 36 | // mrs x0, ID_AA64ZFR0_EL1 = d5380480 37 | WORD $0xd5380480 38 | MOVD R0, ret+0(FP) 39 | RET 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | package cpu 8 | 9 | func getisar0() uint64 10 | func getisar1() uint64 11 | func getpfr0() uint64 12 | func getzfr0() uint64 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | package cpu 8 | 9 | // haveAsmFunctions reports whether the other functions in this file can 10 | // be safely called. 11 | func haveAsmFunctions() bool { return true } 12 | 13 | // The following feature detection functions are defined in cpu_s390x.s. 14 | // They are likely to be expensive to call so the results should be cached. 15 | func stfle() facilityList 16 | func kmQuery() queryResult 17 | func kmcQuery() queryResult 18 | func kmctrQuery() queryResult 19 | func kmaQuery() queryResult 20 | func kimdQuery() queryResult 21 | func klmdQuery() queryResult 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gc_x86.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (386 || amd64 || amd64p32) && gc 6 | 7 | package cpu 8 | 9 | // cpuid is implemented in cpu_gc_x86.s for gc compiler 10 | // and in cpu_gccgo.c for gccgo. 11 | func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) 12 | 13 | // xgetbv with ecx = 0 is implemented in cpu_gc_x86.s for gc compiler 14 | // and in cpu_gccgo.c for gccgo. 15 | func xgetbv() (eax, edx uint32) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gc_x86.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (386 || amd64 || amd64p32) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) 10 | TEXT ·cpuid(SB), NOSPLIT, $0-24 11 | MOVL eaxArg+0(FP), AX 12 | MOVL ecxArg+4(FP), CX 13 | CPUID 14 | MOVL AX, eax+8(FP) 15 | MOVL BX, ebx+12(FP) 16 | MOVL CX, ecx+16(FP) 17 | MOVL DX, edx+20(FP) 18 | RET 19 | 20 | // func xgetbv() (eax, edx uint32) 21 | TEXT ·xgetbv(SB), NOSPLIT, $0-8 22 | MOVL $0, CX 23 | XGETBV 24 | MOVL AX, eax+0(FP) 25 | MOVL DX, edx+4(FP) 26 | RET 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo 6 | 7 | package cpu 8 | 9 | func getisar0() uint64 { return 0 } 10 | func getisar1() uint64 { return 0 } 11 | func getpfr0() uint64 { return 0 } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo 6 | 7 | package cpu 8 | 9 | // haveAsmFunctions reports whether the other functions in this file can 10 | // be safely called. 11 | func haveAsmFunctions() bool { return false } 12 | 13 | // TODO(mundaym): the following feature detection functions are currently 14 | // stubs. See https://golang.org/cl/162887 for how to fix this. 15 | // They are likely to be expensive to call so the results should be cached. 16 | func stfle() facilityList { panic("not implemented for gccgo") } 17 | func kmQuery() queryResult { panic("not implemented for gccgo") } 18 | func kmcQuery() queryResult { panic("not implemented for gccgo") } 19 | func kmctrQuery() queryResult { panic("not implemented for gccgo") } 20 | func kmaQuery() queryResult { panic("not implemented for gccgo") } 21 | func kimdQuery() queryResult { panic("not implemented for gccgo") } 22 | func klmdQuery() queryResult { panic("not implemented for gccgo") } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (386 || amd64 || amd64p32) && gccgo 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | // Need to wrap __get_cpuid_count because it's declared as static. 12 | int 13 | gccgoGetCpuidCount(uint32_t leaf, uint32_t subleaf, 14 | uint32_t *eax, uint32_t *ebx, 15 | uint32_t *ecx, uint32_t *edx) 16 | { 17 | return __get_cpuid_count(leaf, subleaf, eax, ebx, ecx, edx); 18 | } 19 | 20 | #pragma GCC diagnostic ignored "-Wunknown-pragmas" 21 | #pragma GCC push_options 22 | #pragma GCC target("xsave") 23 | #pragma clang attribute push (__attribute__((target("xsave"))), apply_to=function) 24 | 25 | // xgetbv reads the contents of an XCR (Extended Control Register) 26 | // specified in the ECX register into registers EDX:EAX. 27 | // Currently, the only supported value for XCR is 0. 28 | void 29 | gccgoXgetbv(uint32_t *eax, uint32_t *edx) 30 | { 31 | uint64_t v = _xgetbv(0); 32 | *eax = v & 0xffffffff; 33 | *edx = v >> 32; 34 | } 35 | 36 | #pragma clang attribute pop 37 | #pragma GCC pop_options 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (386 || amd64 || amd64p32) && gccgo 6 | 7 | package cpu 8 | 9 | //extern gccgoGetCpuidCount 10 | func gccgoGetCpuidCount(eaxArg, ecxArg uint32, eax, ebx, ecx, edx *uint32) 11 | 12 | func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) { 13 | var a, b, c, d uint32 14 | gccgoGetCpuidCount(eaxArg, ecxArg, &a, &b, &c, &d) 15 | return a, b, c, d 16 | } 17 | 18 | //extern gccgoXgetbv 19 | func gccgoXgetbv(eax, edx *uint32) 20 | 21 | func xgetbv() (eax, edx uint32) { 22 | var a, d uint32 23 | gccgoXgetbv(&a, &d) 24 | return a, d 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !386 && !amd64 && !amd64p32 && !arm64 6 | 7 | package cpu 8 | 9 | func archInit() { 10 | if err := readHWCAP(); err != nil { 11 | return 12 | } 13 | doinit() 14 | Initialized = true 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | func doinit() { 8 | ARM.HasSWP = isSet(hwCap, hwcap_SWP) 9 | ARM.HasHALF = isSet(hwCap, hwcap_HALF) 10 | ARM.HasTHUMB = isSet(hwCap, hwcap_THUMB) 11 | ARM.Has26BIT = isSet(hwCap, hwcap_26BIT) 12 | ARM.HasFASTMUL = isSet(hwCap, hwcap_FAST_MULT) 13 | ARM.HasFPA = isSet(hwCap, hwcap_FPA) 14 | ARM.HasVFP = isSet(hwCap, hwcap_VFP) 15 | ARM.HasEDSP = isSet(hwCap, hwcap_EDSP) 16 | ARM.HasJAVA = isSet(hwCap, hwcap_JAVA) 17 | ARM.HasIWMMXT = isSet(hwCap, hwcap_IWMMXT) 18 | ARM.HasCRUNCH = isSet(hwCap, hwcap_CRUNCH) 19 | ARM.HasTHUMBEE = isSet(hwCap, hwcap_THUMBEE) 20 | ARM.HasNEON = isSet(hwCap, hwcap_NEON) 21 | ARM.HasVFPv3 = isSet(hwCap, hwcap_VFPv3) 22 | ARM.HasVFPv3D16 = isSet(hwCap, hwcap_VFPv3D16) 23 | ARM.HasTLS = isSet(hwCap, hwcap_TLS) 24 | ARM.HasVFPv4 = isSet(hwCap, hwcap_VFPv4) 25 | ARM.HasIDIVA = isSet(hwCap, hwcap_IDIVA) 26 | ARM.HasIDIVT = isSet(hwCap, hwcap_IDIVT) 27 | ARM.HasVFPD32 = isSet(hwCap, hwcap_VFPD32) 28 | ARM.HasLPAE = isSet(hwCap, hwcap_LPAE) 29 | ARM.HasEVTSTRM = isSet(hwCap, hwcap_EVTSTRM) 30 | ARM.HasAES = isSet(hwCap2, hwcap2_AES) 31 | ARM.HasPMULL = isSet(hwCap2, hwcap2_PMULL) 32 | ARM.HasSHA1 = isSet(hwCap2, hwcap2_SHA1) 33 | ARM.HasSHA2 = isSet(hwCap2, hwcap2_SHA2) 34 | ARM.HasCRC32 = isSet(hwCap2, hwcap2_CRC32) 35 | } 36 | 37 | func isSet(hwc uint, value uint) bool { 38 | return hwc&value != 0 39 | } 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (mips64 || mips64le) 6 | 7 | package cpu 8 | 9 | // HWCAP bits. These are exposed by the Linux kernel 5.4. 10 | const ( 11 | // CPU features 12 | hwcap_MIPS_MSA = 1 << 1 13 | ) 14 | 15 | func doinit() { 16 | // HWCAP feature bits 17 | MIPS64X.HasMSA = isSet(hwCap, hwcap_MIPS_MSA) 18 | } 19 | 20 | func isSet(hwc uint, value uint) bool { 21 | return hwc&value != 0 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x && !riscv64 6 | 7 | package cpu 8 | 9 | func doinit() {} 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64 || ppc64le) 6 | 7 | package cpu 8 | 9 | // HWCAP/HWCAP2 bits. These are exposed by the kernel. 10 | const ( 11 | // ISA Level 12 | _PPC_FEATURE2_ARCH_2_07 = 0x80000000 13 | _PPC_FEATURE2_ARCH_3_00 = 0x00800000 14 | 15 | // CPU features 16 | _PPC_FEATURE2_DARN = 0x00200000 17 | _PPC_FEATURE2_SCV = 0x00100000 18 | ) 19 | 20 | func doinit() { 21 | // HWCAP2 feature bits 22 | PPC64.IsPOWER8 = isSet(hwCap2, _PPC_FEATURE2_ARCH_2_07) 23 | PPC64.IsPOWER9 = isSet(hwCap2, _PPC_FEATURE2_ARCH_3_00) 24 | PPC64.HasDARN = isSet(hwCap2, _PPC_FEATURE2_DARN) 25 | PPC64.HasSCV = isSet(hwCap2, _PPC_FEATURE2_SCV) 26 | } 27 | 28 | func isSet(hwc uint, value uint) bool { 29 | return hwc&value != 0 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | const ( 8 | // bit mask values from /usr/include/bits/hwcap.h 9 | hwcap_ZARCH = 2 10 | hwcap_STFLE = 4 11 | hwcap_MSA = 8 12 | hwcap_LDISP = 16 13 | hwcap_EIMM = 32 14 | hwcap_DFP = 64 15 | hwcap_ETF3EH = 256 16 | hwcap_VX = 2048 17 | hwcap_VXE = 8192 18 | ) 19 | 20 | func initS390Xbase() { 21 | // test HWCAP bit vector 22 | has := func(featureMask uint) bool { 23 | return hwCap&featureMask == featureMask 24 | } 25 | 26 | // mandatory 27 | S390X.HasZARCH = has(hwcap_ZARCH) 28 | 29 | // optional 30 | S390X.HasSTFLE = has(hwcap_STFLE) 31 | S390X.HasLDISP = has(hwcap_LDISP) 32 | S390X.HasEIMM = has(hwcap_EIMM) 33 | S390X.HasETF3EH = has(hwcap_ETF3EH) 34 | S390X.HasDFP = has(hwcap_DFP) 35 | S390X.HasMSA = has(hwcap_MSA) 36 | S390X.HasVX = has(hwcap_VX) 37 | if S390X.HasVX { 38 | S390X.HasVXE = has(hwcap_VXE) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_loong64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build loong64 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 64 10 | 11 | func initOptions() { 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_mips64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build mips64 || mips64le 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 32 10 | 11 | func initOptions() { 12 | options = []option{ 13 | {Name: "msa", Feature: &MIPS64X.HasMSA}, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_mipsx.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build mips || mipsle 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 32 10 | 11 | func initOptions() {} 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | // Minimal copy of functionality from x/sys/unix so the cpu package can call 13 | // sysctl without depending on x/sys/unix. 14 | 15 | const ( 16 | // From OpenBSD's sys/sysctl.h. 17 | _CTL_MACHDEP = 7 18 | 19 | // From OpenBSD's machine/cpu.h. 20 | _CPU_ID_AA64ISAR0 = 2 21 | _CPU_ID_AA64ISAR1 = 3 22 | ) 23 | 24 | // Implemented in the runtime package (runtime/sys_openbsd3.go) 25 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 26 | 27 | //go:linkname syscall_syscall6 syscall.syscall6 28 | 29 | func sysctl(mib []uint32, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { 30 | _, _, errno := syscall_syscall6(libc_sysctl_trampoline_addr, uintptr(unsafe.Pointer(&mib[0])), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) 31 | if errno != 0 { 32 | return errno 33 | } 34 | return nil 35 | } 36 | 37 | var libc_sysctl_trampoline_addr uintptr 38 | 39 | //go:cgo_import_dynamic libc_sysctl sysctl "libc.so" 40 | 41 | func sysctlUint64(mib []uint32) (uint64, bool) { 42 | var out uint64 43 | nout := unsafe.Sizeof(out) 44 | if err := sysctl(mib, (*byte)(unsafe.Pointer(&out)), &nout, nil, 0); err != nil { 45 | return 0, false 46 | } 47 | return out, true 48 | } 49 | 50 | func doinit() { 51 | setMinimalFeatures() 52 | 53 | // Get ID_AA64ISAR0 and ID_AA64ISAR1 from sysctl. 54 | isar0, ok := sysctlUint64([]uint32{_CTL_MACHDEP, _CPU_ID_AA64ISAR0}) 55 | if !ok { 56 | return 57 | } 58 | isar1, ok := sysctlUint64([]uint32{_CTL_MACHDEP, _CPU_ID_AA64ISAR1}) 59 | if !ok { 60 | return 61 | } 62 | parseARM64SystemRegisters(isar0, isar1, 0) 63 | 64 | Initialized = true 65 | } 66 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 8 | JMP libc_sysctl(SB) 9 | 10 | GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 11 | DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !linux && arm 6 | 7 | package cpu 8 | 9 | func archInit() {} 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !linux && !netbsd && !openbsd && arm64 6 | 7 | package cpu 8 | 9 | func doinit() {} 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !linux && (mips64 || mips64le) 6 | 7 | package cpu 8 | 9 | func archInit() { 10 | Initialized = true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !aix && !linux && (ppc64 || ppc64le) 6 | 7 | package cpu 8 | 9 | func archInit() { 10 | PPC64.IsPOWER8 = true 11 | Initialized = true 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_riscv64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !linux && riscv64 6 | 7 | package cpu 8 | 9 | func archInit() { 10 | Initialized = true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_x86.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 || amd64p32 || (amd64 && (!darwin || !gc)) 6 | 7 | package cpu 8 | 9 | func darwinSupportsAVX512() bool { 10 | panic("only implemented for gc && amd64 && darwin") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ppc64 || ppc64le 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 128 10 | 11 | func initOptions() { 12 | options = []option{ 13 | {Name: "darn", Feature: &PPC64.HasDARN}, 14 | {Name: "scv", Feature: &PPC64.HasSCV}, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_riscv64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build riscv64 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 64 10 | 11 | func initOptions() { 12 | options = []option{ 13 | {Name: "fastmisaligned", Feature: &RISCV64.HasFastMisaligned}, 14 | {Name: "c", Feature: &RISCV64.HasC}, 15 | {Name: "v", Feature: &RISCV64.HasV}, 16 | {Name: "zba", Feature: &RISCV64.HasZba}, 17 | {Name: "zbb", Feature: &RISCV64.HasZbb}, 18 | {Name: "zbs", Feature: &RISCV64.HasZbs}, 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_wasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build wasm 6 | 7 | package cpu 8 | 9 | // We're compiling the cpu package for an unknown (software-abstracted) CPU. 10 | // Make CacheLinePad an empty struct and hope that the usual struct alignment 11 | // rules are good enough. 12 | 13 | const cacheLineSize = 0 14 | 15 | func initOptions() {} 16 | 17 | func archInit() {} 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_zos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | func archInit() { 8 | doinit() 9 | Initialized = true 10 | } 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_zos_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | func initS390Xbase() { 8 | // get the facilities list 9 | facilities := stfle() 10 | 11 | // mandatory 12 | S390X.HasZARCH = facilities.Has(zarch) 13 | S390X.HasSTFLE = facilities.Has(stflef) 14 | S390X.HasLDISP = facilities.Has(ldisp) 15 | S390X.HasEIMM = facilities.Has(eimm) 16 | 17 | // optional 18 | S390X.HasETF3EH = facilities.Has(etf3eh) 19 | S390X.HasDFP = facilities.Has(dfp) 20 | S390X.HasMSA = facilities.Has(msa) 21 | S390X.HasVX = facilities.Has(vx) 22 | if S390X.HasVX { 23 | S390X.HasVXE = facilities.Has(vxe) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | 7 | package cpu 8 | 9 | // IsBigEndian records whether the GOARCH's byte order is big endian. 10 | const IsBigEndian = true 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh || wasm 6 | 7 | package cpu 8 | 9 | // IsBigEndian records whether the GOARCH's byte order is big endian. 10 | const IsBigEndian = false 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/hwcap_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | import ( 8 | "os" 9 | ) 10 | 11 | const ( 12 | _AT_HWCAP = 16 13 | _AT_HWCAP2 = 26 14 | 15 | procAuxv = "/proc/self/auxv" 16 | 17 | uintSize = int(32 << (^uint(0) >> 63)) 18 | ) 19 | 20 | // For those platforms don't have a 'cpuid' equivalent we use HWCAP/HWCAP2 21 | // These are initialized in cpu_$GOARCH.go 22 | // and should not be changed after they are initialized. 23 | var hwCap uint 24 | var hwCap2 uint 25 | 26 | func readHWCAP() error { 27 | // For Go 1.21+, get auxv from the Go runtime. 28 | if a := getAuxv(); len(a) > 0 { 29 | for len(a) >= 2 { 30 | tag, val := a[0], uint(a[1]) 31 | a = a[2:] 32 | switch tag { 33 | case _AT_HWCAP: 34 | hwCap = val 35 | case _AT_HWCAP2: 36 | hwCap2 = val 37 | } 38 | } 39 | return nil 40 | } 41 | 42 | buf, err := os.ReadFile(procAuxv) 43 | if err != nil { 44 | // e.g. on android /proc/self/auxv is not accessible, so silently 45 | // ignore the error and leave Initialized = false. On some 46 | // architectures (e.g. arm64) doinit() implements a fallback 47 | // readout and will set Initialized = true again. 48 | return err 49 | } 50 | bo := hostByteOrder() 51 | for len(buf) >= 2*(uintSize/8) { 52 | var tag, val uint 53 | switch uintSize { 54 | case 32: 55 | tag = uint(bo.Uint32(buf[0:])) 56 | val = uint(bo.Uint32(buf[4:])) 57 | buf = buf[8:] 58 | case 64: 59 | tag = uint(bo.Uint64(buf[0:])) 60 | val = uint(bo.Uint64(buf[8:])) 61 | buf = buf[16:] 62 | } 63 | switch tag { 64 | case _AT_HWCAP: 65 | hwCap = val 66 | case _AT_HWCAP2: 67 | hwCap2 = val 68 | } 69 | } 70 | return nil 71 | } 72 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/parse.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | import "strconv" 8 | 9 | // parseRelease parses a dot-separated version number. It follows the semver 10 | // syntax, but allows the minor and patch versions to be elided. 11 | // 12 | // This is a copy of the Go runtime's parseRelease from 13 | // https://golang.org/cl/209597. 14 | func parseRelease(rel string) (major, minor, patch int, ok bool) { 15 | // Strip anything after a dash or plus. 16 | for i := 0; i < len(rel); i++ { 17 | if rel[i] == '-' || rel[i] == '+' { 18 | rel = rel[:i] 19 | break 20 | } 21 | } 22 | 23 | next := func() (int, bool) { 24 | for i := 0; i < len(rel); i++ { 25 | if rel[i] == '.' { 26 | ver, err := strconv.Atoi(rel[:i]) 27 | rel = rel[i+1:] 28 | return ver, err == nil 29 | } 30 | } 31 | ver, err := strconv.Atoi(rel) 32 | rel = "" 33 | return ver, err == nil 34 | } 35 | if major, ok = next(); !ok || rel == "" { 36 | return 37 | } 38 | if minor, ok = next(); !ok || rel == "" { 39 | return 40 | } 41 | patch, ok = next() 42 | return 43 | } 44 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && arm64 6 | 7 | package cpu 8 | 9 | import ( 10 | "errors" 11 | "io" 12 | "os" 13 | "strings" 14 | ) 15 | 16 | func readLinuxProcCPUInfo() error { 17 | f, err := os.Open("/proc/cpuinfo") 18 | if err != nil { 19 | return err 20 | } 21 | defer f.Close() 22 | 23 | var buf [1 << 10]byte // enough for first CPU 24 | n, err := io.ReadFull(f, buf[:]) 25 | if err != nil && err != io.ErrUnexpectedEOF { 26 | return err 27 | } 28 | in := string(buf[:n]) 29 | const features = "\nFeatures : " 30 | i := strings.Index(in, features) 31 | if i == -1 { 32 | return errors.New("no CPU features found") 33 | } 34 | in = in[i+len(features):] 35 | if i := strings.Index(in, "\n"); i != -1 { 36 | in = in[:i] 37 | } 38 | m := map[string]*bool{} 39 | 40 | initOptions() // need it early here; it's harmless to call twice 41 | for _, o := range options { 42 | m[o.Name] = o.Feature 43 | } 44 | // The EVTSTRM field has alias "evstrm" in Go, but Linux calls it "evtstrm". 45 | m["evtstrm"] = &ARM64.HasEVTSTRM 46 | 47 | for _, f := range strings.Fields(in) { 48 | if p, ok := m[f]; ok { 49 | *p = true 50 | } 51 | } 52 | return nil 53 | } 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/runtime_auxv.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | // getAuxvFn is non-nil on Go 1.21+ (via runtime_auxv_go121.go init) 8 | // on platforms that use auxv. 9 | var getAuxvFn func() []uintptr 10 | 11 | func getAuxv() []uintptr { 12 | if getAuxvFn == nil { 13 | return nil 14 | } 15 | return getAuxvFn() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/runtime_auxv_go121.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.21 6 | 7 | package cpu 8 | 9 | import ( 10 | _ "unsafe" // for linkname 11 | ) 12 | 13 | //go:linkname runtime_getAuxv runtime.getAuxv 14 | func runtime_getAuxv() []uintptr 15 | 16 | func init() { 17 | getAuxvFn = runtime_getAuxv 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Recreate a getsystemcfg syscall handler instead of 6 | // using the one provided by x/sys/unix to avoid having 7 | // the dependency between them. (See golang.org/issue/32102) 8 | // Moreover, this file will be used during the building of 9 | // gccgo's libgo and thus must not used a CGo method. 10 | 11 | //go:build aix && gccgo 12 | 13 | package cpu 14 | 15 | import ( 16 | "syscall" 17 | ) 18 | 19 | //extern getsystemcfg 20 | func gccgoGetsystemcfg(label uint32) (r uint64) 21 | 22 | func callgetsystemcfg(label int) (r1 uintptr, e1 syscall.Errno) { 23 | r1 = uintptr(gccgoGetsystemcfg(uint32(label))) 24 | e1 = syscall.GetErrno() 25 | return 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Minimal copy of x/sys/unix so the cpu package can make a 6 | // system call on AIX without depending on x/sys/unix. 7 | // (See golang.org/issue/32102) 8 | 9 | //go:build aix && ppc64 && gc 10 | 11 | package cpu 12 | 13 | import ( 14 | "syscall" 15 | "unsafe" 16 | ) 17 | 18 | //go:cgo_import_dynamic libc_getsystemcfg getsystemcfg "libc.a/shr_64.o" 19 | 20 | //go:linkname libc_getsystemcfg libc_getsystemcfg 21 | 22 | type syscallFunc uintptr 23 | 24 | var libc_getsystemcfg syscallFunc 25 | 26 | type errno = syscall.Errno 27 | 28 | // Implemented in runtime/syscall_aix.go. 29 | func rawSyscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err errno) 30 | func syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err errno) 31 | 32 | func callgetsystemcfg(label int) (r1 uintptr, e1 errno) { 33 | r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_getsystemcfg)), 1, uintptr(label), 0, 0, 0, 0, 0) 34 | return 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009 The Go Authors. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google LLC nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/common.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | package language 4 | 5 | // This file contains code common to the maketables.go and the package code. 6 | 7 | // AliasType is the type of an alias in AliasMap. 8 | type AliasType int8 9 | 10 | const ( 11 | Deprecated AliasType = iota 12 | Macro 13 | Legacy 14 | 15 | AliasTypeUnknown AliasType = -1 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/compact.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package language 6 | 7 | // CompactCoreInfo is a compact integer with the three core tags encoded. 8 | type CompactCoreInfo uint32 9 | 10 | // GetCompactCore generates a uint32 value that is guaranteed to be unique for 11 | // different language, region, and script values. 12 | func GetCompactCore(t Tag) (cci CompactCoreInfo, ok bool) { 13 | if t.LangID > langNoIndexOffset { 14 | return 0, false 15 | } 16 | cci |= CompactCoreInfo(t.LangID) << (8 + 12) 17 | cci |= CompactCoreInfo(t.ScriptID) << 12 18 | cci |= CompactCoreInfo(t.RegionID) 19 | return cci, true 20 | } 21 | 22 | // Tag generates a tag from c. 23 | func (c CompactCoreInfo) Tag() Tag { 24 | return Tag{ 25 | LangID: Language(c >> 20), 26 | RegionID: Region(c & 0x3ff), 27 | ScriptID: Script(c>>12) & 0xff, 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/compact/compact.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package compact defines a compact representation of language tags. 6 | // 7 | // Common language tags (at least all for which locale information is defined 8 | // in CLDR) are assigned a unique index. Each Tag is associated with such an 9 | // ID for selecting language-related resources (such as translations) as well 10 | // as one for selecting regional defaults (currency, number formatting, etc.) 11 | // 12 | // It may want to export this functionality at some point, but at this point 13 | // this is only available for use within x/text. 14 | package compact // import "golang.org/x/text/internal/language/compact" 15 | 16 | import ( 17 | "sort" 18 | "strings" 19 | 20 | "golang.org/x/text/internal/language" 21 | ) 22 | 23 | // ID is an integer identifying a single tag. 24 | type ID uint16 25 | 26 | func getCoreIndex(t language.Tag) (id ID, ok bool) { 27 | cci, ok := language.GetCompactCore(t) 28 | if !ok { 29 | return 0, false 30 | } 31 | i := sort.Search(len(coreTags), func(i int) bool { 32 | return cci <= coreTags[i] 33 | }) 34 | if i == len(coreTags) || coreTags[i] != cci { 35 | return 0, false 36 | } 37 | return ID(i), true 38 | } 39 | 40 | // Parent returns the ID of the parent or the root ID if id is already the root. 41 | func (id ID) Parent() ID { 42 | return parents[id] 43 | } 44 | 45 | // Tag converts id to an internal language Tag. 46 | func (id ID) Tag() language.Tag { 47 | if int(id) >= len(coreTags) { 48 | return specialTags[int(id)-len(coreTags)] 49 | } 50 | return coreTags[id].Tag() 51 | } 52 | 53 | var specialTags []language.Tag 54 | 55 | func init() { 56 | tags := strings.Split(specialTagsStr, " ") 57 | specialTags = make([]language.Tag, len(tags)) 58 | for i, t := range tags { 59 | specialTags[i] = language.MustParse(t) 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/coverage.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package language 6 | 7 | // BaseLanguages returns the list of all supported base languages. It generates 8 | // the list by traversing the internal structures. 9 | func BaseLanguages() []Language { 10 | base := make([]Language, 0, NumLanguages) 11 | for i := 0; i < langNoIndexOffset; i++ { 12 | // We included "und" already for the value 0. 13 | if i != nonCanonicalUnd { 14 | base = append(base, Language(i)) 15 | } 16 | } 17 | i := langNoIndexOffset 18 | for _, v := range langNoIndex { 19 | for k := 0; k < 8; k++ { 20 | if v&1 == 1 { 21 | base = append(base, Language(i)) 22 | } 23 | v >>= 1 24 | i++ 25 | } 26 | } 27 | return base 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/tags.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package language 6 | 7 | // MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed. 8 | // It simplifies safe initialization of Tag values. 9 | func MustParse(s string) Tag { 10 | t, err := Parse(s) 11 | if err != nil { 12 | panic(err) 13 | } 14 | return t 15 | } 16 | 17 | // MustParseBase is like ParseBase, but panics if the given base cannot be parsed. 18 | // It simplifies safe initialization of Base values. 19 | func MustParseBase(s string) Language { 20 | b, err := ParseBase(s) 21 | if err != nil { 22 | panic(err) 23 | } 24 | return b 25 | } 26 | 27 | // MustParseScript is like ParseScript, but panics if the given script cannot be 28 | // parsed. It simplifies safe initialization of Script values. 29 | func MustParseScript(s string) Script { 30 | scr, err := ParseScript(s) 31 | if err != nil { 32 | panic(err) 33 | } 34 | return scr 35 | } 36 | 37 | // MustParseRegion is like ParseRegion, but panics if the given region cannot be 38 | // parsed. It simplifies safe initialization of Region values. 39 | func MustParseRegion(s string) Region { 40 | r, err := ParseRegion(s) 41 | if err != nil { 42 | panic(err) 43 | } 44 | return r 45 | } 46 | 47 | // Und is the root language. 48 | var Und Tag 49 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/app_id.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import ( 8 | "strings" 9 | ) 10 | 11 | func parseFullAppID(appid string) (partition, domain, displayID string) { 12 | if i := strings.Index(appid, "~"); i != -1 { 13 | partition, appid = appid[:i], appid[i+1:] 14 | } 15 | if i := strings.Index(appid, ":"); i != -1 { 16 | domain, appid = appid[:i], appid[i+1:] 17 | } 18 | return partition, domain, appid 19 | } 20 | 21 | // appID returns "appid" or "domain.com:appid". 22 | func appID(fullAppID string) string { 23 | _, dom, dis := parseFullAppID(fullAppID) 24 | if dom != "" { 25 | return dom + ":" + dis 26 | } 27 | return dis 28 | } 29 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/base/api_base.proto: -------------------------------------------------------------------------------- 1 | // Built-in base types for API calls. Primarily useful as return types. 2 | 3 | syntax = "proto2"; 4 | option go_package = "base"; 5 | 6 | package appengine.base; 7 | 8 | message StringProto { 9 | required string value = 1; 10 | } 11 | 12 | message Integer32Proto { 13 | required int32 value = 1; 14 | } 15 | 16 | message Integer64Proto { 17 | required int64 value = 1; 18 | } 19 | 20 | message BoolProto { 21 | required bool value = 1; 22 | } 23 | 24 | message DoubleProto { 25 | required double value = 1; 26 | } 27 | 28 | message BytesProto { 29 | required bytes value = 1 [ctype=CORD]; 30 | } 31 | 32 | message VoidProto { 33 | } 34 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/identity.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import ( 8 | "os" 9 | 10 | netcontext "golang.org/x/net/context" 11 | ) 12 | 13 | var ( 14 | // This is set to true in identity_classic.go, which is behind the appengine build tag. 15 | // The appengine build tag is set for the first generation runtimes (<= Go 1.9) but not 16 | // the second generation runtimes (>= Go 1.11), so this indicates whether we're on a 17 | // first-gen runtime. See IsStandard below for the second-gen check. 18 | appengineStandard bool 19 | 20 | // This is set to true in identity_flex.go, which is behind the appenginevm build tag. 21 | appengineFlex bool 22 | ) 23 | 24 | // AppID is the implementation of the wrapper function of the same name in 25 | // ../identity.go. See that file for commentary. 26 | func AppID(c netcontext.Context) string { 27 | return appID(FullyQualifiedAppID(c)) 28 | } 29 | 30 | // IsStandard is the implementation of the wrapper function of the same name in 31 | // ../appengine.go. See that file for commentary. 32 | func IsStandard() bool { 33 | // appengineStandard will be true for first-gen runtimes (<= Go 1.9) but not 34 | // second-gen (>= Go 1.11). 35 | return appengineStandard || IsSecondGen() 36 | } 37 | 38 | // IsStandard is the implementation of the wrapper function of the same name in 39 | // ../appengine.go. See that file for commentary. 40 | func IsSecondGen() bool { 41 | // Second-gen runtimes set $GAE_ENV so we use that to check if we're on a second-gen runtime. 42 | return os.Getenv("GAE_ENV") == "standard" 43 | } 44 | 45 | // IsFlex is the implementation of the wrapper function of the same name in 46 | // ../appengine.go. See that file for commentary. 47 | func IsFlex() bool { 48 | return appengineFlex 49 | } 50 | 51 | // IsAppEngine is the implementation of the wrapper function of the same name in 52 | // ../appengine.go. See that file for commentary. 53 | func IsAppEngine() bool { 54 | return IsStandard() || IsFlex() 55 | } 56 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/identity_classic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package internal 8 | 9 | import ( 10 | "appengine" 11 | 12 | netcontext "golang.org/x/net/context" 13 | ) 14 | 15 | func init() { 16 | appengineStandard = true 17 | } 18 | 19 | func DefaultVersionHostname(ctx netcontext.Context) string { 20 | c := fromContext(ctx) 21 | if c == nil { 22 | panic(errNotAppEngineContext) 23 | } 24 | return appengine.DefaultVersionHostname(c) 25 | } 26 | 27 | func Datacenter(_ netcontext.Context) string { return appengine.Datacenter() } 28 | func ServerSoftware() string { return appengine.ServerSoftware() } 29 | func InstanceID() string { return appengine.InstanceID() } 30 | func IsDevAppServer() bool { return appengine.IsDevAppServer() } 31 | 32 | func RequestID(ctx netcontext.Context) string { 33 | c := fromContext(ctx) 34 | if c == nil { 35 | panic(errNotAppEngineContext) 36 | } 37 | return appengine.RequestID(c) 38 | } 39 | 40 | func ModuleName(ctx netcontext.Context) string { 41 | c := fromContext(ctx) 42 | if c == nil { 43 | panic(errNotAppEngineContext) 44 | } 45 | return appengine.ModuleName(c) 46 | } 47 | func VersionID(ctx netcontext.Context) string { 48 | c := fromContext(ctx) 49 | if c == nil { 50 | panic(errNotAppEngineContext) 51 | } 52 | return appengine.VersionID(c) 53 | } 54 | 55 | func fullyQualifiedAppID(ctx netcontext.Context) string { 56 | c := fromContext(ctx) 57 | if c == nil { 58 | panic(errNotAppEngineContext) 59 | } 60 | return c.FullyQualifiedAppID() 61 | } 62 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/identity_flex.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appenginevm 6 | 7 | package internal 8 | 9 | func init() { 10 | appengineFlex = true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package internal 8 | 9 | import ( 10 | "appengine_internal" 11 | ) 12 | 13 | func Main() { 14 | MainPath = "" 15 | appengine_internal.Main() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/main_common.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | // MainPath stores the file path of the main package. On App Engine Standard 4 | // using Go version 1.9 and below, this will be unset. On App Engine Flex and 5 | // App Engine Standard second-gen (Go 1.11 and above), this will be the 6 | // filepath to package main. 7 | var MainPath string 8 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/main_vm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | 7 | package internal 8 | 9 | import ( 10 | "io" 11 | "log" 12 | "net/http" 13 | "net/url" 14 | "os" 15 | "path/filepath" 16 | "runtime" 17 | ) 18 | 19 | func Main() { 20 | MainPath = filepath.Dir(findMainPath()) 21 | installHealthChecker(http.DefaultServeMux) 22 | 23 | port := "8080" 24 | if s := os.Getenv("PORT"); s != "" { 25 | port = s 26 | } 27 | 28 | host := "" 29 | if IsDevAppServer() { 30 | host = "127.0.0.1" 31 | } 32 | if err := http.ListenAndServe(host+":"+port, http.HandlerFunc(handleHTTP)); err != nil { 33 | log.Fatalf("http.ListenAndServe: %v", err) 34 | } 35 | } 36 | 37 | // Find the path to package main by looking at the root Caller. 38 | func findMainPath() string { 39 | pc := make([]uintptr, 100) 40 | n := runtime.Callers(2, pc) 41 | frames := runtime.CallersFrames(pc[:n]) 42 | for { 43 | frame, more := frames.Next() 44 | // Tests won't have package main, instead they have testing.tRunner 45 | if frame.Function == "main.main" || frame.Function == "testing.tRunner" { 46 | return frame.File 47 | } 48 | if !more { 49 | break 50 | } 51 | } 52 | return "" 53 | } 54 | 55 | func installHealthChecker(mux *http.ServeMux) { 56 | // If no health check handler has been installed by this point, add a trivial one. 57 | const healthPath = "/_ah/health" 58 | hreq := &http.Request{ 59 | Method: "GET", 60 | URL: &url.URL{ 61 | Path: healthPath, 62 | }, 63 | } 64 | if _, pat := mux.Handler(hreq); pat != healthPath { 65 | mux.HandleFunc(healthPath, func(w http.ResponseWriter, r *http.Request) { 66 | io.WriteString(w, "ok") 67 | }) 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/metadata.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | // This file has code for accessing metadata. 8 | // 9 | // References: 10 | // https://cloud.google.com/compute/docs/metadata 11 | 12 | import ( 13 | "fmt" 14 | "io/ioutil" 15 | "net/http" 16 | "net/url" 17 | ) 18 | 19 | const ( 20 | metadataHost = "metadata" 21 | metadataPath = "/computeMetadata/v1/" 22 | ) 23 | 24 | var ( 25 | metadataRequestHeaders = http.Header{ 26 | "Metadata-Flavor": []string{"Google"}, 27 | } 28 | ) 29 | 30 | // TODO(dsymonds): Do we need to support default values, like Python? 31 | func mustGetMetadata(key string) []byte { 32 | b, err := getMetadata(key) 33 | if err != nil { 34 | panic(fmt.Sprintf("Metadata fetch failed for '%s': %v", key, err)) 35 | } 36 | return b 37 | } 38 | 39 | func getMetadata(key string) ([]byte, error) { 40 | // TODO(dsymonds): May need to use url.Parse to support keys with query args. 41 | req := &http.Request{ 42 | Method: "GET", 43 | URL: &url.URL{ 44 | Scheme: "http", 45 | Host: metadataHost, 46 | Path: metadataPath + key, 47 | }, 48 | Header: metadataRequestHeaders, 49 | Host: metadataHost, 50 | } 51 | resp, err := http.DefaultClient.Do(req) 52 | if err != nil { 53 | return nil, err 54 | } 55 | defer resp.Body.Close() 56 | if resp.StatusCode != 200 { 57 | return nil, fmt.Errorf("metadata server returned HTTP %d", resp.StatusCode) 58 | } 59 | return ioutil.ReadAll(resp.Body) 60 | } 61 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/net.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | // This file implements a network dialer that limits the number of concurrent connections. 8 | // It is only used for API calls. 9 | 10 | import ( 11 | "log" 12 | "net" 13 | "runtime" 14 | "sync" 15 | "time" 16 | ) 17 | 18 | var limitSem = make(chan int, 100) // TODO(dsymonds): Use environment variable. 19 | 20 | func limitRelease() { 21 | // non-blocking 22 | select { 23 | case <-limitSem: 24 | default: 25 | // This should not normally happen. 26 | log.Print("appengine: unbalanced limitSem release!") 27 | } 28 | } 29 | 30 | func limitDial(network, addr string) (net.Conn, error) { 31 | limitSem <- 1 32 | 33 | // Dial with a timeout in case the API host is MIA. 34 | // The connection should normally be very fast. 35 | conn, err := net.DialTimeout(network, addr, 10*time.Second) 36 | if err != nil { 37 | limitRelease() 38 | return nil, err 39 | } 40 | lc := &limitConn{Conn: conn} 41 | runtime.SetFinalizer(lc, (*limitConn).Close) // shouldn't usually be required 42 | return lc, nil 43 | } 44 | 45 | type limitConn struct { 46 | close sync.Once 47 | net.Conn 48 | } 49 | 50 | func (lc *limitConn) Close() error { 51 | defer lc.close.Do(func() { 52 | limitRelease() 53 | runtime.SetFinalizer(lc, nil) 54 | }) 55 | return lc.Conn.Close() 56 | } 57 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/regen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # 3 | # This script rebuilds the generated code for the protocol buffers. 4 | # To run this you will need protoc and goprotobuf installed; 5 | # see https://github.com/golang/protobuf for instructions. 6 | 7 | PKG=google.golang.org/appengine 8 | 9 | function die() { 10 | echo 1>&2 $* 11 | exit 1 12 | } 13 | 14 | # Sanity check that the right tools are accessible. 15 | for tool in go protoc protoc-gen-go; do 16 | q=$(which $tool) || die "didn't find $tool" 17 | echo 1>&2 "$tool: $q" 18 | done 19 | 20 | echo -n 1>&2 "finding package dir... " 21 | pkgdir=$(go list -f '{{.Dir}}' $PKG) 22 | echo 1>&2 $pkgdir 23 | base=$(echo $pkgdir | sed "s,/$PKG\$,,") 24 | echo 1>&2 "base: $base" 25 | cd $base 26 | 27 | # Run protoc once per package. 28 | for dir in $(find $PKG/internal -name '*.proto' | xargs dirname | sort | uniq); do 29 | echo 1>&2 "* $dir" 30 | protoc --go_out=. $dir/*.proto 31 | done 32 | 33 | for f in $(find $PKG/internal -name '*.pb.go'); do 34 | # Remove proto.RegisterEnum calls. 35 | # These cause duplicate registration panics when these packages 36 | # are used on classic App Engine. proto.RegisterEnum only affects 37 | # parsing the text format; we don't care about that. 38 | # https://code.google.com/p/googleappengine/issues/detail?id=11670#c17 39 | sed -i '/proto.RegisterEnum/d' $f 40 | done 41 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/remote_api/remote_api.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | option go_package = "remote_api"; 3 | 4 | package remote_api; 5 | 6 | message Request { 7 | required string service_name = 2; 8 | required string method = 3; 9 | required bytes request = 4; 10 | optional string request_id = 5; 11 | } 12 | 13 | message ApplicationError { 14 | required int32 code = 1; 15 | required string detail = 2; 16 | } 17 | 18 | message RpcError { 19 | enum ErrorCode { 20 | UNKNOWN = 0; 21 | CALL_NOT_FOUND = 1; 22 | PARSE_ERROR = 2; 23 | SECURITY_VIOLATION = 3; 24 | OVER_QUOTA = 4; 25 | REQUEST_TOO_LARGE = 5; 26 | CAPABILITY_DISABLED = 6; 27 | FEATURE_DISABLED = 7; 28 | BAD_REQUEST = 8; 29 | RESPONSE_TOO_LARGE = 9; 30 | CANCELLED = 10; 31 | REPLAY_ERROR = 11; 32 | DEADLINE_EXCEEDED = 12; 33 | } 34 | required int32 code = 1; 35 | optional string detail = 2; 36 | } 37 | 38 | message Response { 39 | optional bytes response = 1; 40 | optional bytes exception = 2; 41 | optional ApplicationError application_error = 3; 42 | optional bytes java_exception = 4; 43 | optional RpcError rpc_error = 5; 44 | } 45 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | option go_package = "urlfetch"; 3 | 4 | package appengine; 5 | 6 | message URLFetchServiceError { 7 | enum ErrorCode { 8 | OK = 0; 9 | INVALID_URL = 1; 10 | FETCH_ERROR = 2; 11 | UNSPECIFIED_ERROR = 3; 12 | RESPONSE_TOO_LARGE = 4; 13 | DEADLINE_EXCEEDED = 5; 14 | SSL_CERTIFICATE_ERROR = 6; 15 | DNS_ERROR = 7; 16 | CLOSED = 8; 17 | INTERNAL_TRANSIENT_ERROR = 9; 18 | TOO_MANY_REDIRECTS = 10; 19 | MALFORMED_REPLY = 11; 20 | CONNECTION_ERROR = 12; 21 | } 22 | } 23 | 24 | message URLFetchRequest { 25 | enum RequestMethod { 26 | GET = 1; 27 | POST = 2; 28 | HEAD = 3; 29 | PUT = 4; 30 | DELETE = 5; 31 | PATCH = 6; 32 | } 33 | required RequestMethod Method = 1; 34 | required string Url = 2; 35 | repeated group Header = 3 { 36 | required string Key = 4; 37 | required string Value = 5; 38 | } 39 | optional bytes Payload = 6 [ctype=CORD]; 40 | 41 | optional bool FollowRedirects = 7 [default=true]; 42 | 43 | optional double Deadline = 8; 44 | 45 | optional bool MustValidateServerCertificate = 9 [default=true]; 46 | } 47 | 48 | message URLFetchResponse { 49 | optional bytes Content = 1; 50 | required int32 StatusCode = 2; 51 | repeated group Header = 3 { 52 | required string Key = 4; 53 | required string Value = 5; 54 | } 55 | optional bool ContentWasTruncated = 6 [default=false]; 56 | optional int64 ExternalBytesSent = 7; 57 | optional int64 ExternalBytesReceived = 8; 58 | 59 | optional string FinalUrl = 9; 60 | 61 | optional int64 ApiCpuMilliseconds = 10 [default=0]; 62 | optional int64 ApiBytesSent = 11 [default=0]; 63 | optional int64 ApiBytesReceived = 12 [default=0]; 64 | } 65 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/encoding/prototext/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package prototext marshals and unmarshals protocol buffer messages as the 6 | // textproto format. 7 | package prototext 8 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/descopts/options.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package descopts contains the nil pointers to concrete descriptor options. 6 | // 7 | // This package exists as a form of reverse dependency injection so that certain 8 | // packages (e.g., internal/filedesc and internal/filetype can avoid a direct 9 | // dependency on the descriptor proto package). 10 | package descopts 11 | 12 | import pref "google.golang.org/protobuf/reflect/protoreflect" 13 | 14 | // These variables are set by the init function in descriptor.pb.go via logic 15 | // in internal/filetype. In other words, so long as the descriptor proto package 16 | // is linked in, these variables will be populated. 17 | // 18 | // Each variable is populated with a nil pointer to the options struct. 19 | var ( 20 | File pref.ProtoMessage 21 | Enum pref.ProtoMessage 22 | EnumValue pref.ProtoMessage 23 | Message pref.ProtoMessage 24 | Field pref.ProtoMessage 25 | Oneof pref.ProtoMessage 26 | ExtensionRange pref.ProtoMessage 27 | Service pref.ProtoMessage 28 | Method pref.ProtoMessage 29 | ) 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/detrand/rand.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package detrand provides deterministically random functionality. 6 | // 7 | // The pseudo-randomness of these functions is seeded by the program binary 8 | // itself and guarantees that the output does not change within a program, 9 | // while ensuring that the output is unstable across different builds. 10 | package detrand 11 | 12 | import ( 13 | "encoding/binary" 14 | "hash/fnv" 15 | "os" 16 | ) 17 | 18 | // Disable disables detrand such that all functions returns the zero value. 19 | // This function is not concurrent-safe and must be called during program init. 20 | func Disable() { 21 | randSeed = 0 22 | } 23 | 24 | // Bool returns a deterministically random boolean. 25 | func Bool() bool { 26 | return randSeed%2 == 1 27 | } 28 | 29 | // Intn returns a deterministically random integer between 0 and n-1, inclusive. 30 | func Intn(n int) int { 31 | if n <= 0 { 32 | panic("must be positive") 33 | } 34 | return int(randSeed % uint64(n)) 35 | } 36 | 37 | // randSeed is a best-effort at an approximate hash of the Go binary. 38 | var randSeed = binaryHash() 39 | 40 | func binaryHash() uint64 { 41 | // Open the Go binary. 42 | s, err := os.Executable() 43 | if err != nil { 44 | return 0 45 | } 46 | f, err := os.Open(s) 47 | if err != nil { 48 | return 0 49 | } 50 | defer f.Close() 51 | 52 | // Hash the size and several samples of the Go binary. 53 | const numSamples = 8 54 | var buf [64]byte 55 | h := fnv.New64() 56 | fi, err := f.Stat() 57 | if err != nil { 58 | return 0 59 | } 60 | binary.LittleEndian.PutUint64(buf[:8], uint64(fi.Size())) 61 | h.Write(buf[:8]) 62 | for i := int64(0); i < numSamples; i++ { 63 | if _, err := f.ReadAt(buf[:], i*fi.Size()/numSamples); err != nil { 64 | return 0 65 | } 66 | h.Write(buf[:]) 67 | } 68 | return h.Sum64() 69 | } 70 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/editiondefaults/defaults.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package editiondefaults contains the binary representation of the editions 6 | // defaults. 7 | package editiondefaults 8 | 9 | import _ "embed" 10 | 11 | //go:embed editions_defaults.binpb 12 | var Defaults []byte 13 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuzzyStatic/blizzard/fd2d54fdb2712737274f3848084ff41a4e71ba1d/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/encoding/text/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package text implements the text format for protocol buffers. 6 | // This package has no semantic understanding for protocol buffers and is only 7 | // a parser and composer for the format. 8 | // 9 | // There is no formal specification for the protobuf text format, as such the 10 | // C++ implementation (see google::protobuf::TextFormat) is the reference 11 | // implementation of the text format. 12 | // 13 | // This package is neither a superset nor a subset of the C++ implementation. 14 | // This implementation permits a more liberal grammar in some cases to be 15 | // backwards compatible with the historical Go implementation. 16 | // Future parsings unique to Go should not be added. 17 | // Some grammars allowed by the C++ implementation are deliberately 18 | // not implemented here because they are considered a bug by the protobuf team 19 | // and should not be replicated. 20 | // 21 | // The Go implementation should implement a sufficient amount of the C++ 22 | // grammar such that the default text serialization by C++ can be parsed by Go. 23 | // However, just because the C++ parser accepts some input does not mean that 24 | // the Go implementation should as well. 25 | // 26 | // The text format is almost a superset of JSON except: 27 | // - message keys are not quoted strings, but identifiers 28 | // - the top-level value must be a message without the delimiters 29 | package text 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/errors/is_go112.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.13 6 | // +build !go1.13 7 | 8 | package errors 9 | 10 | import "reflect" 11 | 12 | // Is is a copy of Go 1.13's errors.Is for use with older Go versions. 13 | func Is(err, target error) bool { 14 | if target == nil { 15 | return err == target 16 | } 17 | 18 | isComparable := reflect.TypeOf(target).Comparable() 19 | for { 20 | if isComparable && err == target { 21 | return true 22 | } 23 | if x, ok := err.(interface{ Is(error) bool }); ok && x.Is(target) { 24 | return true 25 | } 26 | if err = unwrap(err); err == nil { 27 | return false 28 | } 29 | } 30 | } 31 | 32 | func unwrap(err error) error { 33 | u, ok := err.(interface { 34 | Unwrap() error 35 | }) 36 | if !ok { 37 | return nil 38 | } 39 | return u.Unwrap() 40 | } 41 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/errors/is_go113.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.13 6 | // +build go1.13 7 | 8 | package errors 9 | 10 | import "errors" 11 | 12 | // Is is errors.Is. 13 | func Is(err, target error) bool { return errors.Is(err, target) } 14 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/flags/flags.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package flags provides a set of flags controlled by build tags. 6 | package flags 7 | 8 | // ProtoLegacy specifies whether to enable support for legacy functionality 9 | // such as MessageSets, weak fields, and various other obscure behavior 10 | // that is necessary to maintain backwards compatibility with proto1 or 11 | // the pre-release variants of proto2 and proto3. 12 | // 13 | // This is disabled by default unless built with the "protolegacy" tag. 14 | // 15 | // WARNING: The compatibility agreement covers nothing provided by this flag. 16 | // As such, functionality may suddenly be removed or changed at our discretion. 17 | const ProtoLegacy = protoLegacy 18 | 19 | // LazyUnmarshalExtensions specifies whether to lazily unmarshal extensions. 20 | // 21 | // Lazy extension unmarshaling validates the contents of message-valued 22 | // extension fields at unmarshal time, but defers creating the message 23 | // structure until the extension is first accessed. 24 | const LazyUnmarshalExtensions = ProtoLegacy 25 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/flags/proto_legacy_disable.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !protolegacy 6 | // +build !protolegacy 7 | 8 | package flags 9 | 10 | const protoLegacy = false 11 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/flags/proto_legacy_enable.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build protolegacy 6 | // +build protolegacy 7 | 8 | package flags 9 | 10 | const protoLegacy = true 11 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/any_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_any_proto = "google/protobuf/any.proto" 14 | 15 | // Names for google.protobuf.Any. 16 | const ( 17 | Any_message_name protoreflect.Name = "Any" 18 | Any_message_fullname protoreflect.FullName = "google.protobuf.Any" 19 | ) 20 | 21 | // Field names for google.protobuf.Any. 22 | const ( 23 | Any_TypeUrl_field_name protoreflect.Name = "type_url" 24 | Any_Value_field_name protoreflect.Name = "value" 25 | 26 | Any_TypeUrl_field_fullname protoreflect.FullName = "google.protobuf.Any.type_url" 27 | Any_Value_field_fullname protoreflect.FullName = "google.protobuf.Any.value" 28 | ) 29 | 30 | // Field numbers for google.protobuf.Any. 31 | const ( 32 | Any_TypeUrl_field_number protoreflect.FieldNumber = 1 33 | Any_Value_field_number protoreflect.FieldNumber = 2 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package genid contains constants for declarations in descriptor.proto 6 | // and the well-known types. 7 | package genid 8 | 9 | import protoreflect "google.golang.org/protobuf/reflect/protoreflect" 10 | 11 | const GoogleProtobuf_package protoreflect.FullName = "google.protobuf" 12 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/duration_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_duration_proto = "google/protobuf/duration.proto" 14 | 15 | // Names for google.protobuf.Duration. 16 | const ( 17 | Duration_message_name protoreflect.Name = "Duration" 18 | Duration_message_fullname protoreflect.FullName = "google.protobuf.Duration" 19 | ) 20 | 21 | // Field names for google.protobuf.Duration. 22 | const ( 23 | Duration_Seconds_field_name protoreflect.Name = "seconds" 24 | Duration_Nanos_field_name protoreflect.Name = "nanos" 25 | 26 | Duration_Seconds_field_fullname protoreflect.FullName = "google.protobuf.Duration.seconds" 27 | Duration_Nanos_field_fullname protoreflect.FullName = "google.protobuf.Duration.nanos" 28 | ) 29 | 30 | // Field numbers for google.protobuf.Duration. 31 | const ( 32 | Duration_Seconds_field_number protoreflect.FieldNumber = 1 33 | Duration_Nanos_field_number protoreflect.FieldNumber = 2 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/empty_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_empty_proto = "google/protobuf/empty.proto" 14 | 15 | // Names for google.protobuf.Empty. 16 | const ( 17 | Empty_message_name protoreflect.Name = "Empty" 18 | Empty_message_fullname protoreflect.FullName = "google.protobuf.Empty" 19 | ) 20 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/field_mask_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_field_mask_proto = "google/protobuf/field_mask.proto" 14 | 15 | // Names for google.protobuf.FieldMask. 16 | const ( 17 | FieldMask_message_name protoreflect.Name = "FieldMask" 18 | FieldMask_message_fullname protoreflect.FullName = "google.protobuf.FieldMask" 19 | ) 20 | 21 | // Field names for google.protobuf.FieldMask. 22 | const ( 23 | FieldMask_Paths_field_name protoreflect.Name = "paths" 24 | 25 | FieldMask_Paths_field_fullname protoreflect.FullName = "google.protobuf.FieldMask.paths" 26 | ) 27 | 28 | // Field numbers for google.protobuf.FieldMask. 29 | const ( 30 | FieldMask_Paths_field_number protoreflect.FieldNumber = 1 31 | ) 32 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/go_features_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_reflect_protodesc_proto_go_features_proto = "reflect/protodesc/proto/go_features.proto" 14 | 15 | // Names for google.protobuf.GoFeatures. 16 | const ( 17 | GoFeatures_message_name protoreflect.Name = "GoFeatures" 18 | GoFeatures_message_fullname protoreflect.FullName = "google.protobuf.GoFeatures" 19 | ) 20 | 21 | // Field names for google.protobuf.GoFeatures. 22 | const ( 23 | GoFeatures_LegacyUnmarshalJsonEnum_field_name protoreflect.Name = "legacy_unmarshal_json_enum" 24 | 25 | GoFeatures_LegacyUnmarshalJsonEnum_field_fullname protoreflect.FullName = "google.protobuf.GoFeatures.legacy_unmarshal_json_enum" 26 | ) 27 | 28 | // Field numbers for google.protobuf.GoFeatures. 29 | const ( 30 | GoFeatures_LegacyUnmarshalJsonEnum_field_number protoreflect.FieldNumber = 1 31 | ) 32 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/goname.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package genid 6 | 7 | // Go names of implementation-specific struct fields in generated messages. 8 | const ( 9 | State_goname = "state" 10 | 11 | SizeCache_goname = "sizeCache" 12 | SizeCacheA_goname = "XXX_sizecache" 13 | 14 | WeakFields_goname = "weakFields" 15 | WeakFieldsA_goname = "XXX_weak" 16 | 17 | UnknownFields_goname = "unknownFields" 18 | UnknownFieldsA_goname = "XXX_unrecognized" 19 | 20 | ExtensionFields_goname = "extensionFields" 21 | ExtensionFieldsA_goname = "XXX_InternalExtensions" 22 | ExtensionFieldsB_goname = "XXX_extensions" 23 | 24 | WeakFieldPrefix_goname = "XXX_weak_" 25 | ) 26 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/map_entry.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package genid 6 | 7 | import protoreflect "google.golang.org/protobuf/reflect/protoreflect" 8 | 9 | // Generic field names and numbers for synthetic map entry messages. 10 | const ( 11 | MapEntry_Key_field_name protoreflect.Name = "key" 12 | MapEntry_Value_field_name protoreflect.Name = "value" 13 | 14 | MapEntry_Key_field_number protoreflect.FieldNumber = 1 15 | MapEntry_Value_field_number protoreflect.FieldNumber = 2 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/source_context_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_source_context_proto = "google/protobuf/source_context.proto" 14 | 15 | // Names for google.protobuf.SourceContext. 16 | const ( 17 | SourceContext_message_name protoreflect.Name = "SourceContext" 18 | SourceContext_message_fullname protoreflect.FullName = "google.protobuf.SourceContext" 19 | ) 20 | 21 | // Field names for google.protobuf.SourceContext. 22 | const ( 23 | SourceContext_FileName_field_name protoreflect.Name = "file_name" 24 | 25 | SourceContext_FileName_field_fullname protoreflect.FullName = "google.protobuf.SourceContext.file_name" 26 | ) 27 | 28 | // Field numbers for google.protobuf.SourceContext. 29 | const ( 30 | SourceContext_FileName_field_number protoreflect.FieldNumber = 1 31 | ) 32 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/timestamp_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_timestamp_proto = "google/protobuf/timestamp.proto" 14 | 15 | // Names for google.protobuf.Timestamp. 16 | const ( 17 | Timestamp_message_name protoreflect.Name = "Timestamp" 18 | Timestamp_message_fullname protoreflect.FullName = "google.protobuf.Timestamp" 19 | ) 20 | 21 | // Field names for google.protobuf.Timestamp. 22 | const ( 23 | Timestamp_Seconds_field_name protoreflect.Name = "seconds" 24 | Timestamp_Nanos_field_name protoreflect.Name = "nanos" 25 | 26 | Timestamp_Seconds_field_fullname protoreflect.FullName = "google.protobuf.Timestamp.seconds" 27 | Timestamp_Nanos_field_fullname protoreflect.FullName = "google.protobuf.Timestamp.nanos" 28 | ) 29 | 30 | // Field numbers for google.protobuf.Timestamp. 31 | const ( 32 | Timestamp_Seconds_field_number protoreflect.FieldNumber = 1 33 | Timestamp_Nanos_field_number protoreflect.FieldNumber = 2 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/wrappers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package genid 6 | 7 | import protoreflect "google.golang.org/protobuf/reflect/protoreflect" 8 | 9 | // Generic field name and number for messages in wrappers.proto. 10 | const ( 11 | WrapperValue_Value_field_name protoreflect.Name = "value" 12 | WrapperValue_Value_field_number protoreflect.FieldNumber = 1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/codec_map_go111.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.12 6 | // +build !go1.12 7 | 8 | package impl 9 | 10 | import "reflect" 11 | 12 | type mapIter struct { 13 | v reflect.Value 14 | keys []reflect.Value 15 | } 16 | 17 | // mapRange provides a less-efficient equivalent to 18 | // the Go 1.12 reflect.Value.MapRange method. 19 | func mapRange(v reflect.Value) *mapIter { 20 | return &mapIter{v: v} 21 | } 22 | 23 | func (i *mapIter) Next() bool { 24 | if i.keys == nil { 25 | i.keys = i.v.MapKeys() 26 | } else { 27 | i.keys = i.keys[1:] 28 | } 29 | return len(i.keys) > 0 30 | } 31 | 32 | func (i *mapIter) Key() reflect.Value { 33 | return i.keys[0] 34 | } 35 | 36 | func (i *mapIter) Value() reflect.Value { 37 | return i.v.MapIndex(i.keys[0]) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/codec_map_go112.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.12 6 | // +build go1.12 7 | 8 | package impl 9 | 10 | import "reflect" 11 | 12 | func mapRange(v reflect.Value) *reflect.MapIter { return v.MapRange() } 13 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/codec_unsafe.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !purego && !appengine 6 | // +build !purego,!appengine 7 | 8 | package impl 9 | 10 | // When using unsafe pointers, we can just treat enum values as int32s. 11 | 12 | var ( 13 | coderEnumNoZero = coderInt32NoZero 14 | coderEnum = coderInt32 15 | coderEnumPtr = coderInt32Ptr 16 | coderEnumSlice = coderInt32Slice 17 | coderEnumPackedSlice = coderInt32PackedSlice 18 | ) 19 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/enum.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package impl 6 | 7 | import ( 8 | "reflect" 9 | 10 | "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | type EnumInfo struct { 14 | GoReflectType reflect.Type // int32 kind 15 | Desc protoreflect.EnumDescriptor 16 | } 17 | 18 | func (t *EnumInfo) New(n protoreflect.EnumNumber) protoreflect.Enum { 19 | return reflect.ValueOf(n).Convert(t.GoReflectType).Interface().(protoreflect.Enum) 20 | } 21 | func (t *EnumInfo) Descriptor() protoreflect.EnumDescriptor { return t.Desc } 22 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/pragma/pragma.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package pragma provides types that can be embedded into a struct to 6 | // statically enforce or prevent certain language properties. 7 | package pragma 8 | 9 | import "sync" 10 | 11 | // NoUnkeyedLiterals can be embedded in a struct to prevent unkeyed literals. 12 | type NoUnkeyedLiterals struct{} 13 | 14 | // DoNotImplement can be embedded in an interface to prevent trivial 15 | // implementations of the interface. 16 | // 17 | // This is useful to prevent unauthorized implementations of an interface 18 | // so that it can be extended in the future for any protobuf language changes. 19 | type DoNotImplement interface{ ProtoInternal(DoNotImplement) } 20 | 21 | // DoNotCompare can be embedded in a struct to prevent comparability. 22 | type DoNotCompare [0]func() 23 | 24 | // DoNotCopy can be embedded in a struct to help prevent shallow copies. 25 | // This does not rely on a Go language feature, but rather a special case 26 | // within the vet checker. 27 | // 28 | // See https://golang.org/issues/8005. 29 | type DoNotCopy [0]sync.Mutex 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/set/ints.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package set provides simple set data structures for uint64s. 6 | package set 7 | 8 | import "math/bits" 9 | 10 | // int64s represents a set of integers within the range of 0..63. 11 | type int64s uint64 12 | 13 | func (bs *int64s) Len() int { 14 | return bits.OnesCount64(uint64(*bs)) 15 | } 16 | func (bs *int64s) Has(n uint64) bool { 17 | return uint64(*bs)&(uint64(1)< 0 18 | } 19 | func (bs *int64s) Set(n uint64) { 20 | *(*uint64)(bs) |= uint64(1) << n 21 | } 22 | func (bs *int64s) Clear(n uint64) { 23 | *(*uint64)(bs) &^= uint64(1) << n 24 | } 25 | 26 | // Ints represents a set of integers within the range of 0..math.MaxUint64. 27 | type Ints struct { 28 | lo int64s 29 | hi map[uint64]struct{} 30 | } 31 | 32 | func (bs *Ints) Len() int { 33 | return bs.lo.Len() + len(bs.hi) 34 | } 35 | func (bs *Ints) Has(n uint64) bool { 36 | if n < 64 { 37 | return bs.lo.Has(n) 38 | } 39 | _, ok := bs.hi[n] 40 | return ok 41 | } 42 | func (bs *Ints) Set(n uint64) { 43 | if n < 64 { 44 | bs.lo.Set(n) 45 | return 46 | } 47 | if bs.hi == nil { 48 | bs.hi = make(map[uint64]struct{}) 49 | } 50 | bs.hi[n] = struct{}{} 51 | } 52 | func (bs *Ints) Clear(n uint64) { 53 | if n < 64 { 54 | bs.lo.Clear(n) 55 | return 56 | } 57 | delete(bs.hi, n) 58 | } 59 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/strs/strings_pure.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build purego || appengine 6 | // +build purego appengine 7 | 8 | package strs 9 | 10 | import pref "google.golang.org/protobuf/reflect/protoreflect" 11 | 12 | func UnsafeString(b []byte) string { 13 | return string(b) 14 | } 15 | 16 | func UnsafeBytes(s string) []byte { 17 | return []byte(s) 18 | } 19 | 20 | type Builder struct{} 21 | 22 | func (*Builder) AppendFullName(prefix pref.FullName, name pref.Name) pref.FullName { 23 | return prefix.Append(name) 24 | } 25 | 26 | func (*Builder) MakeString(b []byte) string { 27 | return string(b) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/equal.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | import ( 8 | "reflect" 9 | 10 | "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | // Equal reports whether two messages are equal, 14 | // by recursively comparing the fields of the message. 15 | // 16 | // - Bytes fields are equal if they contain identical bytes. 17 | // Empty bytes (regardless of nil-ness) are considered equal. 18 | // 19 | // - Floating-point fields are equal if they contain the same value. 20 | // Unlike the == operator, a NaN is equal to another NaN. 21 | // 22 | // - Other scalar fields are equal if they contain the same value. 23 | // 24 | // - Message fields are equal if they have 25 | // the same set of populated known and extension field values, and 26 | // the same set of unknown fields values. 27 | // 28 | // - Lists are equal if they are the same length and 29 | // each corresponding element is equal. 30 | // 31 | // - Maps are equal if they have the same set of keys and 32 | // the corresponding value for each key is equal. 33 | // 34 | // An invalid message is not equal to a valid message. 35 | // An invalid message is only equal to another invalid message of the 36 | // same type. An invalid message often corresponds to a nil pointer 37 | // of the concrete message type. For example, (*pb.M)(nil) is not equal 38 | // to &pb.M{}. 39 | // If two valid messages marshal to the same bytes under deterministic 40 | // serialization, then Equal is guaranteed to report true. 41 | func Equal(x, y Message) bool { 42 | if x == nil || y == nil { 43 | return x == nil && y == nil 44 | } 45 | if reflect.TypeOf(x).Kind() == reflect.Ptr && x == y { 46 | // Avoid an expensive comparison if both inputs are identical pointers. 47 | return true 48 | } 49 | mx := x.ProtoReflect() 50 | my := y.ProtoReflect() 51 | if mx.IsValid() != my.IsValid() { 52 | return false 53 | } 54 | vx := protoreflect.ValueOfMessage(mx) 55 | vy := protoreflect.ValueOfMessage(my) 56 | return vx.Equal(vy) 57 | } 58 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/proto.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | import ( 8 | "google.golang.org/protobuf/internal/errors" 9 | "google.golang.org/protobuf/reflect/protoreflect" 10 | ) 11 | 12 | // Message is the top-level interface that all messages must implement. 13 | // It provides access to a reflective view of a message. 14 | // Any implementation of this interface may be used with all functions in the 15 | // protobuf module that accept a Message, except where otherwise specified. 16 | // 17 | // This is the v2 interface definition for protobuf messages. 18 | // The v1 interface definition is [github.com/golang/protobuf/proto.Message]. 19 | // 20 | // - To convert a v1 message to a v2 message, 21 | // use [google.golang.org/protobuf/protoadapt.MessageV2Of]. 22 | // - To convert a v2 message to a v1 message, 23 | // use [google.golang.org/protobuf/protoadapt.MessageV1Of]. 24 | type Message = protoreflect.ProtoMessage 25 | 26 | // Error matches all errors produced by packages in the protobuf module 27 | // according to [errors.Is]. 28 | // 29 | // Example usage: 30 | // 31 | // if errors.Is(err, proto.Error) { ... } 32 | var Error error 33 | 34 | func init() { 35 | Error = errors.Error 36 | } 37 | 38 | // MessageName returns the full name of m. 39 | // If m is nil, it returns an empty string. 40 | func MessageName(m Message) protoreflect.FullName { 41 | if m == nil { 42 | return "" 43 | } 44 | return m.ProtoReflect().Descriptor().FullName() 45 | } 46 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/proto_methods.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // The protoreflect build tag disables use of fast-path methods. 6 | //go:build !protoreflect 7 | // +build !protoreflect 8 | 9 | package proto 10 | 11 | import ( 12 | "google.golang.org/protobuf/reflect/protoreflect" 13 | "google.golang.org/protobuf/runtime/protoiface" 14 | ) 15 | 16 | const hasProtoMethods = true 17 | 18 | func protoMethods(m protoreflect.Message) *protoiface.Methods { 19 | return m.ProtoMethods() 20 | } 21 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/proto_reflect.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // The protoreflect build tag disables use of fast-path methods. 6 | //go:build protoreflect 7 | // +build protoreflect 8 | 9 | package proto 10 | 11 | import ( 12 | "google.golang.org/protobuf/reflect/protoreflect" 13 | "google.golang.org/protobuf/runtime/protoiface" 14 | ) 15 | 16 | const hasProtoMethods = false 17 | 18 | func protoMethods(m protoreflect.Message) *protoiface.Methods { 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/reset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | import ( 8 | "fmt" 9 | 10 | "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | // Reset clears every field in the message. 14 | // The resulting message shares no observable memory with its previous state 15 | // other than the memory for the message itself. 16 | func Reset(m Message) { 17 | if mr, ok := m.(interface{ Reset() }); ok && hasProtoMethods { 18 | mr.Reset() 19 | return 20 | } 21 | resetMessage(m.ProtoReflect()) 22 | } 23 | 24 | func resetMessage(m protoreflect.Message) { 25 | if !m.IsValid() { 26 | panic(fmt.Sprintf("cannot reset invalid %v message", m.Descriptor().FullName())) 27 | } 28 | 29 | // Clear all known fields. 30 | fds := m.Descriptor().Fields() 31 | for i := 0; i < fds.Len(); i++ { 32 | m.Clear(fds.Get(i)) 33 | } 34 | 35 | // Clear extension fields. 36 | m.Range(func(fd protoreflect.FieldDescriptor, _ protoreflect.Value) bool { 37 | m.Clear(fd) 38 | return true 39 | }) 40 | 41 | // Clear unknown fields. 42 | m.SetUnknown(nil) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/size_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-types. DO NOT EDIT. 6 | 7 | package proto 8 | 9 | import ( 10 | "google.golang.org/protobuf/encoding/protowire" 11 | "google.golang.org/protobuf/reflect/protoreflect" 12 | ) 13 | 14 | func (o MarshalOptions) sizeSingular(num protowire.Number, kind protoreflect.Kind, v protoreflect.Value) int { 15 | switch kind { 16 | case protoreflect.BoolKind: 17 | return protowire.SizeVarint(protowire.EncodeBool(v.Bool())) 18 | case protoreflect.EnumKind: 19 | return protowire.SizeVarint(uint64(v.Enum())) 20 | case protoreflect.Int32Kind: 21 | return protowire.SizeVarint(uint64(int32(v.Int()))) 22 | case protoreflect.Sint32Kind: 23 | return protowire.SizeVarint(protowire.EncodeZigZag(int64(int32(v.Int())))) 24 | case protoreflect.Uint32Kind: 25 | return protowire.SizeVarint(uint64(uint32(v.Uint()))) 26 | case protoreflect.Int64Kind: 27 | return protowire.SizeVarint(uint64(v.Int())) 28 | case protoreflect.Sint64Kind: 29 | return protowire.SizeVarint(protowire.EncodeZigZag(v.Int())) 30 | case protoreflect.Uint64Kind: 31 | return protowire.SizeVarint(v.Uint()) 32 | case protoreflect.Sfixed32Kind: 33 | return protowire.SizeFixed32() 34 | case protoreflect.Fixed32Kind: 35 | return protowire.SizeFixed32() 36 | case protoreflect.FloatKind: 37 | return protowire.SizeFixed32() 38 | case protoreflect.Sfixed64Kind: 39 | return protowire.SizeFixed64() 40 | case protoreflect.Fixed64Kind: 41 | return protowire.SizeFixed64() 42 | case protoreflect.DoubleKind: 43 | return protowire.SizeFixed64() 44 | case protoreflect.StringKind: 45 | return protowire.SizeBytes(len(v.String())) 46 | case protoreflect.BytesKind: 47 | return protowire.SizeBytes(len(v.Bytes())) 48 | case protoreflect.MessageKind: 49 | return protowire.SizeBytes(o.size(v.Message())) 50 | case protoreflect.GroupKind: 51 | return protowire.SizeGroup(num, o.size(v.Message())) 52 | default: 53 | return 0 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/wrappers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | // Bool stores v in a new bool value and returns a pointer to it. 8 | func Bool(v bool) *bool { return &v } 9 | 10 | // Int32 stores v in a new int32 value and returns a pointer to it. 11 | func Int32(v int32) *int32 { return &v } 12 | 13 | // Int64 stores v in a new int64 value and returns a pointer to it. 14 | func Int64(v int64) *int64 { return &v } 15 | 16 | // Float32 stores v in a new float32 value and returns a pointer to it. 17 | func Float32(v float32) *float32 { return &v } 18 | 19 | // Float64 stores v in a new float64 value and returns a pointer to it. 20 | func Float64(v float64) *float64 { return &v } 21 | 22 | // Uint32 stores v in a new uint32 value and returns a pointer to it. 23 | func Uint32(v uint32) *uint32 { return &v } 24 | 25 | // Uint64 stores v in a new uint64 value and returns a pointer to it. 26 | func Uint64(v uint64) *uint64 { return &v } 27 | 28 | // String stores v in a new string value and returns a pointer to it. 29 | func String(v string) *string { return &v } 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build purego || appengine 6 | // +build purego appengine 7 | 8 | package protoreflect 9 | 10 | import "google.golang.org/protobuf/internal/pragma" 11 | 12 | type valueType int 13 | 14 | const ( 15 | nilType valueType = iota 16 | boolType 17 | int32Type 18 | int64Type 19 | uint32Type 20 | uint64Type 21 | float32Type 22 | float64Type 23 | stringType 24 | bytesType 25 | enumType 26 | ifaceType 27 | ) 28 | 29 | // value is a union where only one type can be represented at a time. 30 | // This uses a distinct field for each type. This is type safe in Go, but 31 | // occupies more memory than necessary (72B). 32 | type value struct { 33 | pragma.DoNotCompare // 0B 34 | 35 | typ valueType // 8B 36 | num uint64 // 8B 37 | str string // 16B 38 | bin []byte // 24B 39 | iface interface{} // 16B 40 | } 41 | 42 | func valueOfString(v string) Value { 43 | return Value{typ: stringType, str: v} 44 | } 45 | func valueOfBytes(v []byte) Value { 46 | return Value{typ: bytesType, bin: v} 47 | } 48 | func valueOfIface(v interface{}) Value { 49 | return Value{typ: ifaceType, iface: v} 50 | } 51 | 52 | func (v Value) getString() string { 53 | return v.str 54 | } 55 | func (v Value) getBytes() []byte { 56 | return v.bin 57 | } 58 | func (v Value) getIface() interface{} { 59 | return v.iface 60 | } 61 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/runtime/protoiface/legacy.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package protoiface 6 | 7 | type MessageV1 interface { 8 | Reset() 9 | String() string 10 | ProtoMessage() 11 | } 12 | 13 | type ExtensionRangeV1 struct { 14 | Start, End int32 // both inclusive 15 | } 16 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/runtime/protoimpl/impl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package protoimpl contains the default implementation for messages 6 | // generated by protoc-gen-go. 7 | // 8 | // WARNING: This package should only ever be imported by generated messages. 9 | // The compatibility agreement covers nothing except for functionality needed 10 | // to keep existing generated messages operational. Breakages that occur due 11 | // to unauthorized usages of this package are not the author's responsibility. 12 | package protoimpl 13 | 14 | import ( 15 | "google.golang.org/protobuf/internal/filedesc" 16 | "google.golang.org/protobuf/internal/filetype" 17 | "google.golang.org/protobuf/internal/impl" 18 | ) 19 | 20 | // UnsafeEnabled specifies whether package unsafe can be used. 21 | const UnsafeEnabled = impl.UnsafeEnabled 22 | 23 | type ( 24 | // Types used by generated code in init functions. 25 | DescBuilder = filedesc.Builder 26 | TypeBuilder = filetype.Builder 27 | 28 | // Types used by generated code to implement EnumType, MessageType, and ExtensionType. 29 | EnumInfo = impl.EnumInfo 30 | MessageInfo = impl.MessageInfo 31 | ExtensionInfo = impl.ExtensionInfo 32 | 33 | // Types embedded in generated messages. 34 | MessageState = impl.MessageState 35 | SizeCache = impl.SizeCache 36 | WeakFields = impl.WeakFields 37 | UnknownFields = impl.UnknownFields 38 | ExtensionFields = impl.ExtensionFields 39 | ExtensionFieldV1 = impl.ExtensionField 40 | 41 | Pointer = impl.Pointer 42 | ) 43 | 44 | var X impl.Export 45 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2023 Google Inc. All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file or at 6 | // https://developers.google.com/open-source/licenses/bsd 7 | 8 | syntax = "proto2"; 9 | 10 | package google.protobuf; 11 | 12 | import "google/protobuf/descriptor.proto"; 13 | 14 | option go_package = "google.golang.org/protobuf/types/gofeaturespb"; 15 | 16 | extend google.protobuf.FeatureSet { 17 | optional GoFeatures go = 1002; 18 | } 19 | 20 | message GoFeatures { 21 | // Whether or not to generate the deprecated UnmarshalJSON method for enums. 22 | optional bool legacy_unmarshal_json_enum = 1 [ 23 | retention = RETENTION_RUNTIME, 24 | targets = TARGET_TYPE_ENUM, 25 | edition_defaults = { edition: EDITION_PROTO2, value: "true" }, 26 | edition_defaults = { edition: EDITION_PROTO3, value: "false" } 27 | ]; 28 | } 29 | -------------------------------------------------------------------------------- /wow/wow.go: -------------------------------------------------------------------------------- 1 | // Package wowp contains types for the World of Warcraft Profile APIs 2 | package wow 3 | 4 | // Bracket type 5 | type Bracket string 6 | 7 | // Bracket field for PVP API calls 8 | const ( 9 | Bracket2v2 Bracket = "2v2" 10 | Bracket3v3 Bracket = "3v3" 11 | BracketRBG Bracket = "rbg" 12 | ) 13 | -------------------------------------------------------------------------------- /wowcgd/auctionHouse.go: -------------------------------------------------------------------------------- 1 | package wowcgd 2 | 3 | // AuctionHouseIndex structure 4 | type AuctionHouseIndex struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Auctions []struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Name string `json:"name"` 15 | ID int `json:"id"` 16 | } `json:"auctions"` 17 | } 18 | 19 | // Auctions structure 20 | type Auctions struct { 21 | Linkds struct { 22 | Self struct { 23 | Href string `json:"href"` 24 | } `json:"self"` 25 | } `json:"_links"` 26 | ConnectedRealm struct { 27 | Href string `json:"href"` 28 | } `json:"connected_realm"` 29 | Auctions []Auction `json:"auctions"` 30 | ID int `json:"id"` 31 | Name string `json:"name"` 32 | } 33 | 34 | // Auction structure 35 | type Auction struct { 36 | ID int `json:"id"` 37 | Item struct { 38 | ID int `json:"id"` 39 | } `json:"item"` 40 | Bid int `json:"bid"` 41 | Buyout int `json:"buyout"` 42 | Quantity int `json:"quantity"` 43 | TimeLeft string `json:"time_left"` 44 | } 45 | -------------------------------------------------------------------------------- /wowcgd/guildCrest.go: -------------------------------------------------------------------------------- 1 | package wowcgd 2 | 3 | // GuildCrestComponentsIndex structure 4 | type GuildCrestComponentsIndex struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Emblems []struct { 11 | ID int `json:"id"` 12 | Media struct { 13 | Key struct { 14 | Href string `json:"href"` 15 | } `json:"key"` 16 | } `json:"media"` 17 | } `json:"emblems"` 18 | Borders []struct { 19 | ID int `json:"id"` 20 | Media struct { 21 | Key struct { 22 | Href string `json:"href"` 23 | } `json:"key"` 24 | } `json:"media"` 25 | } `json:"borders"` 26 | } 27 | 28 | // GuildCrestBorderMedia structure 29 | type GuildCrestBorderMedia struct { 30 | Links struct { 31 | Self struct { 32 | Href string `json:"href"` 33 | } `json:"self"` 34 | } `json:"_links"` 35 | Assets []struct { 36 | Key string `json:"key"` 37 | Value string `json:"value"` 38 | } `json:"assets"` 39 | } 40 | 41 | // GuildCrestEmblemMedia structure 42 | type GuildCrestEmblemMedia struct { 43 | Links struct { 44 | Self struct { 45 | Href string `json:"href"` 46 | } `json:"self"` 47 | } `json:"_links"` 48 | Assets []struct { 49 | Key string `json:"key"` 50 | Value string `json:"value"` 51 | } `json:"assets"` 52 | } 53 | -------------------------------------------------------------------------------- /wowcgd/mediaSearch.go: -------------------------------------------------------------------------------- 1 | package wowcgd 2 | 3 | // MediaSearch Structure 4 | type MediaSearch struct { 5 | Page int `json:"page"` 6 | PageSize int `json:"pageSize"` 7 | MaxPageSize int `json:"maxPageSize"` 8 | PageCount int `json:"pageCount"` 9 | ResultCountCapped bool `json:"resultCountCapped"` 10 | Results []struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Data struct { 15 | Assets []struct { 16 | FileDataID int `json:"file_data_id"` 17 | Value string `json:"value"` 18 | Key string `json:"key"` 19 | } `json:"assets"` 20 | ID int `json:"id"` 21 | } `json:"data"` 22 | } `json:"results"` 23 | } 24 | -------------------------------------------------------------------------------- /wowcgd/playableClass.go: -------------------------------------------------------------------------------- 1 | package wowcgd 2 | 3 | // PlayableClassesIndex structure 4 | type PlayableClassesIndex struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Classes []struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Name string `json:"name"` 15 | ID int `json:"id"` 16 | } `json:"classes"` 17 | } 18 | 19 | // PlayableClass structure 20 | type PlayableClass struct { 21 | Links struct { 22 | Self struct { 23 | Href string `json:"href"` 24 | } `json:"self"` 25 | } `json:"_links"` 26 | ID int `json:"id"` 27 | Name string `json:"name"` 28 | GenderName struct { 29 | Male string `json:"male"` 30 | Female string `json:"female"` 31 | } `json:"gender_name"` 32 | PowerType struct { 33 | Key struct { 34 | Href string `json:"href"` 35 | } `json:"key"` 36 | Name string `json:"name"` 37 | ID int `json:"id"` 38 | } `json:"power_type"` 39 | Media struct { 40 | Key struct { 41 | Href string `json:"href"` 42 | } `json:"key"` 43 | ID int `json:"id"` 44 | } `json:"media"` 45 | PvpTalentSlots struct { 46 | Href string `json:"href"` 47 | } `json:"pvp_talent_slots"` 48 | } 49 | 50 | // PlayableClassMedia structure 51 | type PlayableClassMedia struct { 52 | Links struct { 53 | Self struct { 54 | Href string `json:"href"` 55 | } `json:"self"` 56 | } `json:"_links"` 57 | } 58 | -------------------------------------------------------------------------------- /wowcgd/playableRace.go: -------------------------------------------------------------------------------- 1 | package wowcgd 2 | 3 | // PlayableRacesIndex structure 4 | type PlayableRacesIndex struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Races []struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Name string `json:"name"` 15 | ID int `json:"id"` 16 | } `json:"races"` 17 | } 18 | 19 | // PlayableRace structure 20 | type PlayableRace struct { 21 | Links struct { 22 | Self struct { 23 | Href string `json:"href"` 24 | } `json:"self"` 25 | } `json:"_links"` 26 | ID int `json:"id"` 27 | Name string `json:"name"` 28 | GenderName struct { 29 | Male string `json:"male"` 30 | Female string `json:"female"` 31 | } `json:"gender_name"` 32 | Faction struct { 33 | Type string `json:"type"` 34 | Name string `json:"name"` 35 | } `json:"faction"` 36 | IsSelectable bool `json:"is_selectable"` 37 | IsAlliedRace bool `json:"is_allied_race"` 38 | } 39 | -------------------------------------------------------------------------------- /wowcgd/powerType.go: -------------------------------------------------------------------------------- 1 | package wowcgd 2 | 3 | // PowerTypesIndex structure 4 | type PowerTypesIndex struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | PowerTypes []struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Name string `json:"name"` 15 | ID int `json:"id"` 16 | } `json:"power_types"` 17 | } 18 | 19 | // PowerType structure 20 | type PowerType struct { 21 | Links struct { 22 | Self struct { 23 | Href string `json:"href"` 24 | } `json:"self"` 25 | } `json:"_links"` 26 | ID int `json:"id"` 27 | Name string `json:"name"` 28 | } 29 | -------------------------------------------------------------------------------- /wowcgd/region.go: -------------------------------------------------------------------------------- 1 | package wowcgd 2 | 3 | // RegionIndex structure 4 | type RegionIndex struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Regions []struct { 11 | Href string `json:"href"` 12 | } `json:"regions"` 13 | } 14 | 15 | // Region structure 16 | type Region struct { 17 | Links struct { 18 | Self struct { 19 | Href string `json:"href"` 20 | } `json:"self"` 21 | } `json:"_links"` 22 | ID int `json:"id"` 23 | Name string `json:"name"` 24 | Tag string `json:"tag"` 25 | } 26 | -------------------------------------------------------------------------------- /wowcgd/wowcgd.go: -------------------------------------------------------------------------------- 1 | // Package wowcgd contains types for the World of Warcraft Classic Game Data APIs 2 | package wowcgd 3 | -------------------------------------------------------------------------------- /wowgd/auctionHouse.go: -------------------------------------------------------------------------------- 1 | package wowgd 2 | 3 | // AuctionHouse structure 4 | type AuctionHouse struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | ConnectedRealm struct { 11 | Href string `json:"href"` 12 | } `json:"connected_realm"` 13 | Auctions []struct { 14 | ID int `json:"id"` 15 | Item struct { 16 | ID int `json:"id"` 17 | Context int `json:"context"` 18 | BonusLists []int `json:"bonus_lists"` 19 | Modifiers []struct { 20 | Type int `json:"type"` 21 | Value int `json:"value"` 22 | } `json:"modifiers"` 23 | PetBreedID int `json:"pet_breed_id"` 24 | PetLevel int `json:"pet_level"` 25 | PetQualityID int `json:"pet_quality_id"` 26 | PetSpeciesID int `json:"pet_species_id"` 27 | } `json:"item"` 28 | Buyout int `json:"buyout"` 29 | Quantity int `json:"quantity"` 30 | UnitPrice int `json:"unit_price"` 31 | TimeLeft TimeLeft `json:"time_left"` 32 | } `json:"auctions"` 33 | } 34 | -------------------------------------------------------------------------------- /wowgd/auctionHouseCommodities.go: -------------------------------------------------------------------------------- 1 | package wowgd 2 | 3 | // AuctionHouseCommodities structure 4 | type AuctionHouseCommodities struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Auctions []struct { 11 | ID int `json:"id"` 12 | Item struct { 13 | ID int `json:"id"` 14 | } `json:"item"` 15 | Quantity int `json:"quantity"` 16 | UnitPrice int `json:"unit_price"` 17 | TimeLeft TimeLeft `json:"time_left"` 18 | } `json:"auctions"` 19 | } 20 | -------------------------------------------------------------------------------- /wowgd/guildCrest.go: -------------------------------------------------------------------------------- 1 | package wowgd 2 | 3 | // GuildCrestComponentsIndex structure 4 | type GuildCrestComponentsIndex struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Emblems []struct { 11 | ID int `json:"id"` 12 | Media struct { 13 | Key struct { 14 | Href string `json:"href"` 15 | } `json:"key"` 16 | } `json:"media"` 17 | } `json:"emblems"` 18 | Borders []struct { 19 | ID int `json:"id"` 20 | Media struct { 21 | Key struct { 22 | Href string `json:"href"` 23 | } `json:"key"` 24 | } `json:"media"` 25 | } `json:"borders"` 26 | } 27 | 28 | // GuildCrestBorderMedia structure 29 | type GuildCrestBorderMedia struct { 30 | Links struct { 31 | Self struct { 32 | Href string `json:"href"` 33 | } `json:"self"` 34 | } `json:"_links"` 35 | Assets []struct { 36 | Key string `json:"key"` 37 | Value string `json:"value"` 38 | } `json:"assets"` 39 | } 40 | 41 | // GuildCrestEmblemMedia structure 42 | type GuildCrestEmblemMedia struct { 43 | Links struct { 44 | Self struct { 45 | Href string `json:"href"` 46 | } `json:"self"` 47 | } `json:"_links"` 48 | Assets []struct { 49 | Key string `json:"key"` 50 | Value string `json:"value"` 51 | } `json:"assets"` 52 | } 53 | -------------------------------------------------------------------------------- /wowgd/mediaSearch.go: -------------------------------------------------------------------------------- 1 | package wowgd 2 | 3 | // MediaSearch Structure 4 | type MediaSearch struct { 5 | Page int `json:"page"` 6 | PageSize int `json:"pageSize"` 7 | MaxPageSize int `json:"maxPageSize"` 8 | PageCount int `json:"pageCount"` 9 | ResultCountCapped bool `json:"resultCountCapped"` 10 | Results []struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Data struct { 15 | Assets []struct { 16 | FileDataID int `json:"file_data_id"` 17 | Value string `json:"value"` 18 | Key string `json:"key"` 19 | } `json:"assets"` 20 | ID int `json:"id"` 21 | } `json:"data"` 22 | } `json:"results"` 23 | } 24 | -------------------------------------------------------------------------------- /wowgd/modifiedCrafting.go: -------------------------------------------------------------------------------- 1 | package wowgd 2 | 3 | // ModifiedCraftingIndex structure 4 | type ModifiedCraftingIndex struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Categories struct { 11 | Href string `json:"href"` 12 | } `json:"categories"` 13 | SlotTypes struct { 14 | Href string `json:"href"` 15 | } `json:"slot_types"` 16 | } 17 | 18 | // ModifiedCraftingCategoryIndex structure 19 | type ModifiedCraftingCategoryIndex struct { 20 | Links struct { 21 | Self struct { 22 | Href string `json:"href"` 23 | } `json:"self"` 24 | } `json:"_links"` 25 | Categories []struct { 26 | Key struct { 27 | Href string `json:"href"` 28 | } `json:"key"` 29 | Name string `json:"name"` 30 | ID int `json:"id"` 31 | } `json:"categories"` 32 | } 33 | 34 | // ModifiedCraftingCategory structure 35 | type ModifiedCraftingCategory struct { 36 | Links struct { 37 | Self struct { 38 | Href string `json:"href"` 39 | } `json:"self"` 40 | } `json:"_links"` 41 | ID int `json:"id"` 42 | Name string `json:"name"` 43 | } 44 | 45 | // ModifiedCraftingReagentSlotTypeIndex structure 46 | type ModifiedCraftingReagentSlotTypeIndex struct { 47 | Links struct { 48 | Self struct { 49 | Href string `json:"href"` 50 | } `json:"self"` 51 | } `json:"_links"` 52 | SlotTypes []struct { 53 | Key struct { 54 | Href string `json:"href"` 55 | } `json:"key"` 56 | Name string `json:"name,omitempty"` 57 | ID int `json:"id"` 58 | } `json:"slot_types"` 59 | } 60 | 61 | // ModifiedCraftingReagentSlotType structure 62 | type ModifiedCraftingReagentSlotType struct { 63 | Links struct { 64 | Self struct { 65 | Href string `json:"href"` 66 | } `json:"self"` 67 | } `json:"_links"` 68 | ID int `json:"id"` 69 | Description string `json:"description"` 70 | CompatibleCategories []struct { 71 | Key struct { 72 | Href string `json:"href"` 73 | } `json:"key"` 74 | Name string `json:"name"` 75 | ID int `json:"id"` 76 | } `json:"compatible_categories"` 77 | } 78 | -------------------------------------------------------------------------------- /wowgd/mythicKeystoneAffix.go: -------------------------------------------------------------------------------- 1 | package wowgd 2 | 3 | // MythicKeystoneAffixIndex structure 4 | type MythicKeystoneAffixIndex struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Affixes []struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Name string `json:"name"` 15 | ID int `json:"id"` 16 | } `json:"affixes"` 17 | } 18 | 19 | // MythicKeystoneAffix structure 20 | type MythicKeystoneAffix struct { 21 | Links struct { 22 | Self struct { 23 | Href string `json:"href"` 24 | } `json:"self"` 25 | } `json:"_links"` 26 | ID int `json:"id"` 27 | Name string `json:"name"` 28 | Description string `json:"description"` 29 | Media struct { 30 | Key struct { 31 | Href string `json:"href"` 32 | } `json:"key"` 33 | ID int `json:"id"` 34 | } `json:"media"` 35 | } 36 | 37 | // MythicKeystoneAffixMedia structure 38 | type MythicKeystoneAffixMedia struct { 39 | Links struct { 40 | Self struct { 41 | Href string `json:"href"` 42 | } `json:"self"` 43 | } `json:"_links"` 44 | Assets []struct { 45 | Key string `json:"key"` 46 | Value string `json:"value"` 47 | FileDataID int `json:"file_data_id"` 48 | } `json:"assets"` 49 | ID int `json:"id"` 50 | } 51 | -------------------------------------------------------------------------------- /wowgd/mythicRaidLeaderboard.go: -------------------------------------------------------------------------------- 1 | package wowgd 2 | 3 | // MythicRaidLeaderboard structure 4 | type MythicRaidLeaderboard struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Slug string `json:"slug"` 11 | CriteriaType string `json:"criteria_type"` 12 | Zone struct { 13 | Key struct { 14 | Href string `json:"href"` 15 | } `json:"key"` 16 | Name string `json:"name"` 17 | } `json:"zone"` 18 | Entries []struct { 19 | Guild struct { 20 | Name string `json:"name"` 21 | ID int `json:"id"` 22 | Realm struct { 23 | Name string `json:"name"` 24 | ID int `json:"id"` 25 | Slug string `json:"slug"` 26 | } `json:"realm"` 27 | } `json:"guild"` 28 | Faction struct { 29 | Type string `json:"type"` 30 | } `json:"faction"` 31 | Timestamp int64 `json:"timestamp"` 32 | Region string `json:"region"` 33 | Rank int `json:"rank"` 34 | } `json:"entries"` 35 | } 36 | -------------------------------------------------------------------------------- /wowgd/playableRace.go: -------------------------------------------------------------------------------- 1 | package wowgd 2 | 3 | // PlayableRacesIndex structure 4 | type PlayableRacesIndex struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Races []struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Name string `json:"name"` 15 | ID int `json:"id"` 16 | } `json:"races"` 17 | } 18 | 19 | // PlayableRace structure 20 | type PlayableRace struct { 21 | Links struct { 22 | Self struct { 23 | Href string `json:"href"` 24 | } `json:"self"` 25 | } `json:"_links"` 26 | ID int `json:"id"` 27 | Name string `json:"name"` 28 | GenderName struct { 29 | Male string `json:"male"` 30 | Female string `json:"female"` 31 | } `json:"gender_name"` 32 | Faction struct { 33 | Type string `json:"type"` 34 | Name string `json:"name"` 35 | } `json:"faction"` 36 | IsSelectable bool `json:"is_selectable"` 37 | IsAlliedRace bool `json:"is_allied_race"` 38 | } 39 | -------------------------------------------------------------------------------- /wowgd/powerType.go: -------------------------------------------------------------------------------- 1 | package wowgd 2 | 3 | // PowerTypesIndex structure 4 | type PowerTypesIndex struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | PowerTypes []struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Name string `json:"name"` 15 | ID int `json:"id"` 16 | } `json:"power_types"` 17 | } 18 | 19 | // PowerType structure 20 | type PowerType struct { 21 | Links struct { 22 | Self struct { 23 | Href string `json:"href"` 24 | } `json:"self"` 25 | } `json:"_links"` 26 | ID int `json:"id"` 27 | Name string `json:"name"` 28 | } 29 | -------------------------------------------------------------------------------- /wowgd/pvpTier.go: -------------------------------------------------------------------------------- 1 | package wowgd 2 | 3 | // PvPTierMedia structure 4 | type PvPTierMedia struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Assets []struct { 11 | Key string `json:"key"` 12 | Value string `json:"value"` 13 | } `json:"assets"` 14 | } 15 | 16 | // PvPTiersIndex structure 17 | type PvPTiersIndex struct { 18 | Links struct { 19 | Self struct { 20 | Href string `json:"href"` 21 | } `json:"self"` 22 | } `json:"_links"` 23 | Tiers []struct { 24 | Key struct { 25 | Href string `json:"href"` 26 | } `json:"key"` 27 | Name string `json:"name"` 28 | ID int `json:"id"` 29 | } `json:"tiers"` 30 | } 31 | 32 | // PvPTier structure 33 | type PvPTier struct { 34 | Links struct { 35 | Self struct { 36 | Href string `json:"href"` 37 | } `json:"self"` 38 | } `json:"_links"` 39 | ID int `json:"id"` 40 | Name string `json:"name"` 41 | MinRating int `json:"min_rating"` 42 | MaxRating int `json:"max_rating"` 43 | Media struct { 44 | Key struct { 45 | Href string `json:"href"` 46 | } `json:"key"` 47 | } `json:"media"` 48 | Bracket struct { 49 | ID int `json:"id"` 50 | Type string `json:"type"` 51 | } `json:"bracket"` 52 | RatingType int `json:"rating_type"` 53 | } 54 | -------------------------------------------------------------------------------- /wowgd/region.go: -------------------------------------------------------------------------------- 1 | package wowgd 2 | 3 | // RegionIndex structure 4 | type RegionIndex struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Regions []struct { 11 | Href string `json:"href"` 12 | } `json:"regions"` 13 | } 14 | 15 | // Region structure 16 | type Region struct { 17 | Links struct { 18 | Self struct { 19 | Href string `json:"href"` 20 | } `json:"self"` 21 | } `json:"_links"` 22 | ID int `json:"id"` 23 | Name string `json:"name"` 24 | Tag string `json:"tag"` 25 | } 26 | -------------------------------------------------------------------------------- /wowgd/reputations.go: -------------------------------------------------------------------------------- 1 | package wowgd 2 | 3 | // ReputationFactionsIndex structure 4 | type ReputationFactionsIndex struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Factions []struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Name string `json:"name"` 15 | ID int `json:"id"` 16 | } `json:"factions"` 17 | RootFactions []struct { 18 | Key struct { 19 | Href string `json:"href"` 20 | } `json:"key"` 21 | Name string `json:"name"` 22 | ID int `json:"id"` 23 | } `json:"root_factions"` 24 | } 25 | 26 | // ReputationFaction structure 27 | type ReputationFaction struct { 28 | Links struct { 29 | Self struct { 30 | Href string `json:"href"` 31 | } `json:"self"` 32 | } `json:"_links"` 33 | ID int `json:"id"` 34 | Name string `json:"name"` 35 | Description string `json:"description"` 36 | ReputationTiers struct { 37 | Key struct { 38 | Href string `json:"href"` 39 | } `json:"key"` 40 | ID int `json:"id"` 41 | } `json:"reputation_tiers"` 42 | } 43 | 44 | // ReputationTiersIndex structure 45 | type ReputationTiersIndex struct { 46 | Links struct { 47 | Self struct { 48 | Href string `json:"href"` 49 | } `json:"self"` 50 | } `json:"_links"` 51 | ReputationTiers []struct { 52 | Key struct { 53 | Href string `json:"href"` 54 | } `json:"key"` 55 | ID int `json:"id"` 56 | Name string `json:"name,omitempty"` 57 | } `json:"reputation_tiers"` 58 | } 59 | 60 | // ReputationTiers structure 61 | type ReputationTiers struct { 62 | Links struct { 63 | Self struct { 64 | Href string `json:"href"` 65 | } `json:"self"` 66 | } `json:"_links"` 67 | ID int `json:"id"` 68 | Tiers []struct { 69 | Name string `json:"name"` 70 | MinValue int `json:"min_value"` 71 | MaxValue int `json:"max_value"` 72 | ID int `json:"id"` 73 | } `json:"tiers"` 74 | Faction struct { 75 | Key struct { 76 | Href string `json:"href"` 77 | } `json:"key"` 78 | Name string `json:"name"` 79 | ID int `json:"id"` 80 | } `json:"faction"` 81 | } 82 | -------------------------------------------------------------------------------- /wowgd/spell.go: -------------------------------------------------------------------------------- 1 | package wowgd 2 | 3 | // Spell structure 4 | type Spell struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | ID int `json:"id"` 11 | Name string `json:"name"` 12 | Description string `json:"description"` 13 | Media struct { 14 | Key struct { 15 | Href string `json:"href"` 16 | } `json:"key"` 17 | ID int `json:"id"` 18 | } `json:"media"` 19 | } 20 | 21 | // SpellMedia structure 22 | type SpellMedia struct { 23 | Links struct { 24 | Self struct { 25 | Href string `json:"href"` 26 | } `json:"self"` 27 | } `json:"_links"` 28 | Assets []struct { 29 | Key string `json:"key"` 30 | Value string `json:"value"` 31 | FileDataID int `json:"file_data_id"` 32 | } `json:"assets"` 33 | ID int `json:"id"` 34 | } 35 | 36 | // SpellSearch structure 37 | type SpellSearch struct { 38 | Page int `json:"page"` 39 | PageSize int `json:"pageSize"` 40 | MaxPageSize int `json:"maxPageSize"` 41 | PageCount int `json:"pageCount"` 42 | Results []struct { 43 | Key struct { 44 | Href string `json:"href"` 45 | } `json:"key"` 46 | Data struct { 47 | Name struct { 48 | ItIT string `json:"it_IT"` 49 | RuRU string `json:"ru_RU"` 50 | EnGB string `json:"en_GB"` 51 | ZhTW string `json:"zh_TW"` 52 | KoKR string `json:"ko_KR"` 53 | EnUS string `json:"en_US"` 54 | EsMX string `json:"es_MX"` 55 | PtBR string `json:"pt_BR"` 56 | EsES string `json:"es_ES"` 57 | ZhCN string `json:"zh_CN"` 58 | FrFR string `json:"fr_FR"` 59 | DeDE string `json:"de_DE"` 60 | } `json:"name"` 61 | ID int `json:"id"` 62 | Media struct { 63 | ID int `json:"id"` 64 | } `json:"media"` 65 | } `json:"data"` 66 | } `json:"results"` 67 | } 68 | -------------------------------------------------------------------------------- /wowgd/title.go: -------------------------------------------------------------------------------- 1 | package wowgd 2 | 3 | // TitlesIndex structure 4 | type TitlesIndex struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Titles []struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Name string `json:"name"` 15 | ID int `json:"id"` 16 | } `json:"titles"` 17 | } 18 | 19 | // Title structure 20 | type Title struct { 21 | Links struct { 22 | Self struct { 23 | Href string `json:"href"` 24 | } `json:"self"` 25 | } `json:"_links"` 26 | ID int `json:"id"` 27 | Name string `json:"name"` 28 | GenderName struct { 29 | Male string `json:"male"` 30 | Female string `json:"female"` 31 | } `json:"gender_name"` 32 | } 33 | -------------------------------------------------------------------------------- /wowgd/wowToken.go: -------------------------------------------------------------------------------- 1 | package wowgd 2 | 3 | // Token structure 4 | type Token struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | LastUpdatedTimestamp int64 `json:"last_updated_timestamp"` 11 | Price int `json:"price"` 12 | } 13 | -------------------------------------------------------------------------------- /wowgd/wowgd.go: -------------------------------------------------------------------------------- 1 | // Package wowgd contains types for the World of Warcraft Game Data APIs 2 | package wowgd 3 | 4 | // Bracket type 5 | type Bracket string 6 | 7 | // Bracket field for PVP API calls 8 | const ( 9 | Bracket2v2 Bracket = "2v2" 10 | Bracket3v3 Bracket = "3v3" 11 | BracketRBG Bracket = "rbg" 12 | ) 13 | 14 | // TimeLeft string 15 | type TimeLeft string 16 | 17 | // TimeLeft field for Auction House structure 18 | const ( 19 | TimeLeftShort TimeLeft = "SHORT" 20 | TimeLeftMedium TimeLeft = "MEDIUM" 21 | TimeLeftLong TimeLeft = "LONG" 22 | TimeLeftVeryLong TimeLeft = "VERY_LONG" 23 | ) 24 | -------------------------------------------------------------------------------- /wowp/accountProfileSummary.go: -------------------------------------------------------------------------------- 1 | package wowp 2 | 3 | // AccountProfileSummary structure 4 | type AccountProfileSummary struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | User struct { 10 | Href string `json:"href"` 11 | } `json:"user"` 12 | Profile struct { 13 | Href string `json:"href"` 14 | } `json:"profile"` 15 | } `json:"_links"` 16 | ID int `json:"id"` 17 | WowAccounts []struct { 18 | ID int `json:"id"` 19 | Characters []struct { 20 | Character struct { 21 | Href string `json:"href"` 22 | } `json:"character"` 23 | ProtectedCharacter struct { 24 | Href string `json:"href"` 25 | } `json:"protected_character"` 26 | Name string `json:"name"` 27 | ID int `json:"id"` 28 | Realm struct { 29 | Key struct { 30 | Href string `json:"href"` 31 | } `json:"key"` 32 | Name string `json:"name"` 33 | ID int `json:"id"` 34 | Slug string `json:"slug"` 35 | } `json:"realm"` 36 | PlayableClass struct { 37 | Key struct { 38 | Href string `json:"href"` 39 | } `json:"key"` 40 | Name string `json:"name"` 41 | ID int `json:"id"` 42 | } `json:"playable_class"` 43 | PlayableRace struct { 44 | Key struct { 45 | Href string `json:"href"` 46 | } `json:"key"` 47 | Name string `json:"name"` 48 | ID int `json:"id"` 49 | } `json:"playable_race"` 50 | Gender struct { 51 | Type string `json:"type"` 52 | Name string `json:"name"` 53 | } `json:"gender"` 54 | Faction struct { 55 | Type string `json:"type"` 56 | Name string `json:"name"` 57 | } `json:"faction"` 58 | Level int `json:"level"` 59 | } `json:"characters"` 60 | } `json:"wow_accounts"` 61 | Collections struct { 62 | Href string `json:"href"` 63 | } `json:"collections"` 64 | } 65 | -------------------------------------------------------------------------------- /wowp/characterHunterPets.go: -------------------------------------------------------------------------------- 1 | package wowp 2 | 3 | // CharacterHunterPetsSummary structure 4 | type CharacterHunterPetsSummary struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Character struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Name string `json:"name"` 15 | ID int `json:"id"` 16 | Realm struct { 17 | Key struct { 18 | Href string `json:"href"` 19 | } `json:"key"` 20 | Name string `json:"name"` 21 | ID int `json:"id"` 22 | Slug string `json:"slug"` 23 | } `json:"realm"` 24 | } `json:"character"` 25 | HunterPets []struct { 26 | Name string `json:"name"` 27 | Level int `json:"level"` 28 | Creature struct { 29 | Key struct { 30 | Href string `json:"href"` 31 | } `json:"key"` 32 | Name string `json:"name"` 33 | ID int `json:"id"` 34 | } `json:"creature"` 35 | Slot int `json:"slot"` 36 | IsActive bool `json:"is_active"` 37 | CreatureDisplay struct { 38 | Key struct { 39 | Href string `json:"href"` 40 | } `json:"key"` 41 | } `json:"creature_display"` 42 | } `json:"hunter_pets"` 43 | } 44 | -------------------------------------------------------------------------------- /wowp/characterMedia.go: -------------------------------------------------------------------------------- 1 | package wowp 2 | 3 | // CharacterMediaSummary structure 4 | type CharacterMediaSummary struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Character struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Name string `json:"name"` 15 | ID int `json:"id"` 16 | Realm struct { 17 | Key struct { 18 | Href string `json:"href"` 19 | } `json:"key"` 20 | Name string `json:"name"` 21 | ID int `json:"id"` 22 | Slug string `json:"slug"` 23 | } `json:"realm"` 24 | } `json:"character"` 25 | Assets []struct { 26 | Key string `json:"key"` 27 | Value string `json:"value"` 28 | } `json:"assets"` 29 | } 30 | -------------------------------------------------------------------------------- /wowp/characterProfessions.go: -------------------------------------------------------------------------------- 1 | package wowp 2 | 3 | // CharacterProfessionsSummary structure 4 | type CharacterProfessionsSummary struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Character struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Name string `json:"name"` 15 | ID int `json:"id"` 16 | Realm struct { 17 | Key struct { 18 | Href string `json:"href"` 19 | } `json:"key"` 20 | Name string `json:"name"` 21 | ID int `json:"id"` 22 | Slug string `json:"slug"` 23 | } `json:"realm"` 24 | } `json:"character"` 25 | Primaries []struct { 26 | Profession struct { 27 | Key struct { 28 | Href string `json:"href"` 29 | } `json:"key"` 30 | Name string `json:"name"` 31 | ID int `json:"id"` 32 | } `json:"profession"` 33 | Tiers []struct { 34 | SkillPoints int `json:"skill_points"` 35 | MaxSkillPoints int `json:"max_skill_points"` 36 | Tier struct { 37 | Name string `json:"name"` 38 | ID int `json:"id"` 39 | } `json:"tier"` 40 | KnownRecipes []struct { 41 | Key struct { 42 | Href string `json:"href"` 43 | } `json:"key"` 44 | Name string `json:"name"` 45 | ID int `json:"id"` 46 | } `json:"known_recipes"` 47 | } `json:"tiers"` 48 | } `json:"primaries"` 49 | Secondaries []struct { 50 | Profession struct { 51 | Key struct { 52 | Href string `json:"href"` 53 | } `json:"key"` 54 | Name string `json:"name"` 55 | ID int `json:"id"` 56 | } `json:"profession"` 57 | Tiers []struct { 58 | SkillPoints int `json:"skill_points"` 59 | MaxSkillPoints int `json:"max_skill_points"` 60 | Tier struct { 61 | Name string `json:"name"` 62 | ID int `json:"id"` 63 | } `json:"tier"` 64 | KnownRecipes []struct { 65 | Key struct { 66 | Href string `json:"href"` 67 | } `json:"key"` 68 | Name string `json:"name"` 69 | ID int `json:"id"` 70 | } `json:"known_recipes"` 71 | } `json:"tiers"` 72 | } `json:"secondaries"` 73 | } 74 | -------------------------------------------------------------------------------- /wowp/characterQuests.go: -------------------------------------------------------------------------------- 1 | package wowp 2 | 3 | // CharacterQuests structure 4 | type CharacterQuests struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Character struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Name string `json:"name"` 15 | ID int `json:"id"` 16 | Realm struct { 17 | Key struct { 18 | Href string `json:"href"` 19 | } `json:"key"` 20 | Name string `json:"name"` 21 | ID int `json:"id"` 22 | Slug string `json:"slug"` 23 | } `json:"realm"` 24 | } `json:"character"` 25 | InProgress []struct { 26 | Key struct { 27 | Href string `json:"href"` 28 | } `json:"key"` 29 | Name string `json:"name"` 30 | ID int `json:"id"` 31 | } `json:"in_progress"` 32 | Completed struct { 33 | Href string `json:"href"` 34 | } `json:"completed"` 35 | } 36 | 37 | // CharacterCompletedQuests structure 38 | type CharacterCompletedQuests struct { 39 | Links struct { 40 | Self struct { 41 | Href string `json:"href"` 42 | } `json:"self"` 43 | } `json:"_links"` 44 | Character struct { 45 | Key struct { 46 | Href string `json:"href"` 47 | } `json:"key"` 48 | Name string `json:"name"` 49 | ID int `json:"id"` 50 | Realm struct { 51 | Key struct { 52 | Href string `json:"href"` 53 | } `json:"key"` 54 | Name string `json:"name"` 55 | ID int `json:"id"` 56 | Slug string `json:"slug"` 57 | } `json:"realm"` 58 | } `json:"character"` 59 | Quests []struct { 60 | Key struct { 61 | Href string `json:"href"` 62 | } `json:"key"` 63 | Name string `json:"name"` 64 | ID int `json:"id"` 65 | } `json:"quests"` 66 | } 67 | -------------------------------------------------------------------------------- /wowp/characterReputations.go: -------------------------------------------------------------------------------- 1 | package wowp 2 | 3 | // CharacterReputationsSummary structure 4 | type CharacterReputationsSummary struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Character struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Name string `json:"name"` 15 | ID int `json:"id"` 16 | Realm struct { 17 | Key struct { 18 | Href string `json:"href"` 19 | } `json:"key"` 20 | Name string `json:"name"` 21 | ID int `json:"id"` 22 | Slug string `json:"slug"` 23 | } `json:"realm"` 24 | } `json:"character"` 25 | Reputations []struct { 26 | Faction struct { 27 | Key struct { 28 | Href string `json:"href"` 29 | } `json:"key"` 30 | Name string `json:"name"` 31 | ID int `json:"id"` 32 | } `json:"faction"` 33 | Standing struct { 34 | Raw int `json:"raw"` 35 | Value int `json:"value"` 36 | Max int `json:"max"` 37 | Tier int `json:"tier"` 38 | Name string `json:"name"` 39 | RenownLevel int `json:"renown_level"` 40 | } `json:"standing"` 41 | Paragon struct { 42 | Raw int `json:"raw"` 43 | Value int `json:"value"` 44 | Max int `json:"max"` 45 | } `json:"paragon,omitempty"` 46 | } `json:"reputations"` 47 | } 48 | -------------------------------------------------------------------------------- /wowp/characterSoulbinds.go: -------------------------------------------------------------------------------- 1 | package wowp 2 | 3 | // CharacterSoulbinds structure 4 | type CharacterSoulbinds struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Character struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Name string `json:"name"` 15 | ID int `json:"id"` 16 | Realm struct { 17 | Key struct { 18 | Href string `json:"href"` 19 | } `json:"key"` 20 | Name string `json:"name"` 21 | ID int `json:"id"` 22 | Slug string `json:"slug"` 23 | } `json:"realm"` 24 | } `json:"character"` 25 | ChosenCovenant struct { 26 | Key struct { 27 | Href string `json:"href"` 28 | } `json:"key"` 29 | Name string `json:"name"` 30 | ID int `json:"id"` 31 | } `json:"chosen_covenant"` 32 | RenownLevel int `json:"renown_level"` 33 | Soulbinds []struct { 34 | Soulbind struct { 35 | Key struct { 36 | Href string `json:"href"` 37 | } `json:"key"` 38 | Name string `json:"name"` 39 | ID int `json:"id"` 40 | } `json:"soulbind"` 41 | Traits []struct { 42 | Trait struct { 43 | Key struct { 44 | Href string `json:"href"` 45 | } `json:"key"` 46 | Name string `json:"name"` 47 | ID int `json:"id"` 48 | } `json:"trait,omitempty"` 49 | Tier int `json:"tier"` 50 | DisplayOrder int `json:"display_order"` 51 | ConduitSocket struct { 52 | Type struct { 53 | Type string `json:"type"` 54 | Name string `json:"name"` 55 | } `json:"type"` 56 | Socket struct { 57 | Conduit struct { 58 | Key struct { 59 | Href string `json:"href"` 60 | } `json:"key"` 61 | Name string `json:"name"` 62 | ID int `json:"id"` 63 | } `json:"conduit"` 64 | Rank int `json:"rank"` 65 | } `json:"socket"` 66 | } `json:"conduit_socket,omitempty"` 67 | } `json:"traits"` 68 | IsActive bool `json:"is_active,omitempty"` 69 | } `json:"soulbinds"` 70 | } 71 | -------------------------------------------------------------------------------- /wowp/characterTitles.go: -------------------------------------------------------------------------------- 1 | package wowp 2 | 3 | // CharacterTitlesSummary structure 4 | type CharacterTitlesSummary struct { 5 | Links struct { 6 | Self struct { 7 | Href string `json:"href"` 8 | } `json:"self"` 9 | } `json:"_links"` 10 | Character struct { 11 | Key struct { 12 | Href string `json:"href"` 13 | } `json:"key"` 14 | Name string `json:"name"` 15 | ID int `json:"id"` 16 | Realm struct { 17 | Key struct { 18 | Href string `json:"href"` 19 | } `json:"key"` 20 | Name string `json:"name"` 21 | ID int `json:"id"` 22 | Slug string `json:"slug"` 23 | } `json:"realm"` 24 | } `json:"character"` 25 | ActiveTitle struct { 26 | Key struct { 27 | Href string `json:"href"` 28 | } `json:"key"` 29 | Name string `json:"name"` 30 | ID int `json:"id"` 31 | DisplayString string `json:"display_string"` 32 | } `json:"active_title"` 33 | Titles []struct { 34 | Key struct { 35 | Href string `json:"href"` 36 | } `json:"key"` 37 | Name string `json:"name"` 38 | ID int `json:"id"` 39 | } `json:"titles"` 40 | } 41 | --------------------------------------------------------------------------------